2020-09-02 12:45:46 +00:00
|
|
|
package object
|
|
|
|
|
|
|
|
import (
|
2023-07-06 12:36:41 +00:00
|
|
|
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
2023-03-07 13:38:26 +00:00
|
|
|
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
2020-09-02 12:45:46 +00:00
|
|
|
)
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
// AddressOf returns the address of the object.
|
2023-07-06 12:36:41 +00:00
|
|
|
func AddressOf(obj *objectSDK.Object) oid.Address {
|
2022-05-31 17:00:41 +00:00
|
|
|
var addr oid.Address
|
2022-05-12 16:37:46 +00:00
|
|
|
|
2022-05-31 17:00:41 +00:00
|
|
|
id, ok := obj.ID()
|
|
|
|
if ok {
|
|
|
|
addr.SetObject(id)
|
|
|
|
}
|
2020-09-16 12:27:48 +00:00
|
|
|
|
2022-05-31 17:00:41 +00:00
|
|
|
cnr, ok := obj.ContainerID()
|
|
|
|
if ok {
|
|
|
|
addr.SetContainer(cnr)
|
2020-10-01 11:42:17 +00:00
|
|
|
}
|
|
|
|
|
2022-05-31 17:00:41 +00:00
|
|
|
return addr
|
2020-10-01 11:42:17 +00:00
|
|
|
}
|