diff --git a/pkg/client/object.go b/pkg/client/object.go index 4ce865fc..11296e16 100644 --- a/pkg/client/object.go +++ b/pkg/client/object.go @@ -578,7 +578,7 @@ func (c *Client) getObjectHeaderV2(ctx context.Context, p *ObjectHeaderParams, o obj.SetHeader(hdr) raw := object.NewRawFromV2(obj) - raw.SetID(p.addr.GetObjectID()) + raw.SetID(p.addr.ObjectID()) // convert the object return raw.Object(), nil diff --git a/pkg/object/address.go b/pkg/object/address.go index 9f61c9f7..7f2bfe77 100644 --- a/pkg/object/address.go +++ b/pkg/object/address.go @@ -37,8 +37,8 @@ func (a *Address) ToV2() *refs.Address { return (*refs.Address)(a) } -// GetContainerID returns container identifier. -func (a *Address) GetContainerID() *container.ID { +// ContainerID returns container identifier. +func (a *Address) ContainerID() *container.ID { return container.NewIDFromV2( (*refs.Address)(a).GetContainerID(), ) @@ -49,8 +49,8 @@ func (a *Address) SetContainerID(id *container.ID) { (*refs.Address)(a).SetContainerID(id.ToV2()) } -// GetObjectID returns object identifier. -func (a *Address) GetObjectID() *ID { +// ObjectID returns object identifier. +func (a *Address) ObjectID() *ID { return NewIDFromV2( (*refs.Address)(a).GetObjectID(), ) @@ -87,8 +87,8 @@ func (a *Address) Parse(s string) error { // String returns string representation of Object.Address. func (a *Address) String() string { return strings.Join([]string{ - a.GetContainerID().String(), - a.GetObjectID().String(), + a.ContainerID().String(), + a.ObjectID().String(), }, addressSeparator) } diff --git a/pkg/object/address_test.go b/pkg/object/address_test.go index aa67e587..d0316705 100644 --- a/pkg/object/address_test.go +++ b/pkg/object/address_test.go @@ -16,7 +16,7 @@ func TestAddress_SetContainerID(t *testing.T) { a.SetContainerID(cid) - require.Equal(t, cid, a.GetContainerID()) + require.Equal(t, cid, a.ContainerID()) } func TestAddress_SetObjectID(t *testing.T) { @@ -26,7 +26,7 @@ func TestAddress_SetObjectID(t *testing.T) { a.SetObjectID(oid) - require.Equal(t, oid, a.GetObjectID()) + require.Equal(t, oid, a.ObjectID()) } func TestAddress_Parse(t *testing.T) { @@ -41,8 +41,8 @@ func TestAddress_Parse(t *testing.T) { a := NewAddress() require.NoError(t, a.Parse(s)) - require.Equal(t, oid, a.GetObjectID()) - require.Equal(t, cid, a.GetContainerID()) + require.Equal(t, oid, a.ObjectID()) + require.Equal(t, cid, a.ContainerID()) }) t.Run("should fail for bad address", func(t *testing.T) {