v2/refs: Implement remaining uni-structures

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-17 12:03:52 +03:00 committed by Stanislav Bogatyrev
parent a68252c956
commit 1b262fc072
2 changed files with 89 additions and 19 deletions

View file

@ -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
}
}

89
v2/refs/types.go Normal file
View file

@ -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
}
}