diff --git a/v2/refs/owner.go b/v2/refs/owner.go deleted file mode 100644 index acaa6928..00000000 --- a/v2/refs/owner.go +++ /dev/null @@ -1,19 +0,0 @@ -package refs - -type OwnerID struct { - val []byte -} - -func (o *OwnerID) GetValue() []byte { - if o != nil { - return o.val - } - - return nil -} - -func (o *OwnerID) SetValue(v []byte) { - if o != nil { - o.val = v - } -} diff --git a/v2/refs/types.go b/v2/refs/types.go new file mode 100644 index 00000000..dd21c44f --- /dev/null +++ b/v2/refs/types.go @@ -0,0 +1,89 @@ +package refs + +type OwnerID struct { + val []byte +} + +type ContainerID struct { + val []byte +} + +type ObjectID struct { + val []byte +} + +type Address struct { + cid *ContainerID + + oid *ObjectID +} + +func (o *OwnerID) GetValue() []byte { + if o != nil { + return o.val + } + + return nil +} + +func (o *OwnerID) SetValue(v []byte) { + if o != nil { + o.val = v + } +} + +func (o *ContainerID) GetValue() []byte { + if o != nil { + return o.val + } + + return nil +} + +func (o *ContainerID) SetValue(v []byte) { + if o != nil { + o.val = v + } +} + +func (o *ObjectID) GetValue() []byte { + if o != nil { + return o.val + } + + return nil +} + +func (o *ObjectID) SetValue(v []byte) { + if o != nil { + o.val = v + } +} + +func (a *Address) GetContainerID() *ContainerID { + if a != nil { + return a.cid + } + + return nil +} + +func (a *Address) SetContainerID(v *ContainerID) { + if a != nil { + a.cid = v + } +} + +func (a *Address) GetObjectID() *ObjectID { + if a != nil { + return a.oid + } + + return nil +} + +func (a *Address) SetObjectID(v *ObjectID) { + if a != nil { + a.oid = v + } +}