From 1b262fc07247a5e31321be2355006fc6c94f757d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 17 Aug 2020 12:03:52 +0300 Subject: [PATCH] v2/refs: Implement remaining uni-structures Signed-off-by: Leonard Lyubich --- v2/refs/owner.go | 19 ----------- v2/refs/types.go | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 19 deletions(-) delete mode 100644 v2/refs/owner.go create mode 100644 v2/refs/types.go diff --git a/v2/refs/owner.go b/v2/refs/owner.go deleted file mode 100644 index acaa692..0000000 --- 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 0000000..dd21c44 --- /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 + } +}