2020-09-02 12:45:46 +00:00
|
|
|
package object
|
|
|
|
|
|
|
|
import (
|
2021-11-10 07:08:33 +00:00
|
|
|
"github.com/nspcc-dev/neofs-sdk-go/object"
|
2022-01-26 12:11:13 +00:00
|
|
|
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
2020-09-02 12:45:46 +00:00
|
|
|
)
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
// AddressOf returns the address of the object.
|
2022-03-03 14:19:05 +00:00
|
|
|
func AddressOf(obj *object.Object) *addressSDK.Address {
|
|
|
|
if obj != nil {
|
|
|
|
addr := addressSDK.NewAddress()
|
|
|
|
addr.SetObjectID(obj.ID())
|
|
|
|
addr.SetContainerID(obj.ContainerID())
|
2020-09-16 12:27:48 +00:00
|
|
|
|
2022-03-03 14:19:05 +00:00
|
|
|
return addr
|
2020-10-01 11:42:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|