forked from TrueCloudLab/frostfs-api-go
[#197] sdk/object: Rename getters of Address type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9f0bc50e53
commit
67bcf6eb4d
3 changed files with 11 additions and 11 deletions
|
@ -578,7 +578,7 @@ func (c *Client) getObjectHeaderV2(ctx context.Context, p *ObjectHeaderParams, o
|
||||||
obj.SetHeader(hdr)
|
obj.SetHeader(hdr)
|
||||||
|
|
||||||
raw := object.NewRawFromV2(obj)
|
raw := object.NewRawFromV2(obj)
|
||||||
raw.SetID(p.addr.GetObjectID())
|
raw.SetID(p.addr.ObjectID())
|
||||||
|
|
||||||
// convert the object
|
// convert the object
|
||||||
return raw.Object(), nil
|
return raw.Object(), nil
|
||||||
|
|
|
@ -37,8 +37,8 @@ func (a *Address) ToV2() *refs.Address {
|
||||||
return (*refs.Address)(a)
|
return (*refs.Address)(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetContainerID returns container identifier.
|
// ContainerID returns container identifier.
|
||||||
func (a *Address) GetContainerID() *container.ID {
|
func (a *Address) ContainerID() *container.ID {
|
||||||
return container.NewIDFromV2(
|
return container.NewIDFromV2(
|
||||||
(*refs.Address)(a).GetContainerID(),
|
(*refs.Address)(a).GetContainerID(),
|
||||||
)
|
)
|
||||||
|
@ -49,8 +49,8 @@ func (a *Address) SetContainerID(id *container.ID) {
|
||||||
(*refs.Address)(a).SetContainerID(id.ToV2())
|
(*refs.Address)(a).SetContainerID(id.ToV2())
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetObjectID returns object identifier.
|
// ObjectID returns object identifier.
|
||||||
func (a *Address) GetObjectID() *ID {
|
func (a *Address) ObjectID() *ID {
|
||||||
return NewIDFromV2(
|
return NewIDFromV2(
|
||||||
(*refs.Address)(a).GetObjectID(),
|
(*refs.Address)(a).GetObjectID(),
|
||||||
)
|
)
|
||||||
|
@ -87,8 +87,8 @@ func (a *Address) Parse(s string) error {
|
||||||
// String returns string representation of Object.Address.
|
// String returns string representation of Object.Address.
|
||||||
func (a *Address) String() string {
|
func (a *Address) String() string {
|
||||||
return strings.Join([]string{
|
return strings.Join([]string{
|
||||||
a.GetContainerID().String(),
|
a.ContainerID().String(),
|
||||||
a.GetObjectID().String(),
|
a.ObjectID().String(),
|
||||||
}, addressSeparator)
|
}, addressSeparator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ func TestAddress_SetContainerID(t *testing.T) {
|
||||||
|
|
||||||
a.SetContainerID(cid)
|
a.SetContainerID(cid)
|
||||||
|
|
||||||
require.Equal(t, cid, a.GetContainerID())
|
require.Equal(t, cid, a.ContainerID())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAddress_SetObjectID(t *testing.T) {
|
func TestAddress_SetObjectID(t *testing.T) {
|
||||||
|
@ -26,7 +26,7 @@ func TestAddress_SetObjectID(t *testing.T) {
|
||||||
|
|
||||||
a.SetObjectID(oid)
|
a.SetObjectID(oid)
|
||||||
|
|
||||||
require.Equal(t, oid, a.GetObjectID())
|
require.Equal(t, oid, a.ObjectID())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAddress_Parse(t *testing.T) {
|
func TestAddress_Parse(t *testing.T) {
|
||||||
|
@ -41,8 +41,8 @@ func TestAddress_Parse(t *testing.T) {
|
||||||
a := NewAddress()
|
a := NewAddress()
|
||||||
|
|
||||||
require.NoError(t, a.Parse(s))
|
require.NoError(t, a.Parse(s))
|
||||||
require.Equal(t, oid, a.GetObjectID())
|
require.Equal(t, oid, a.ObjectID())
|
||||||
require.Equal(t, cid, a.GetContainerID())
|
require.Equal(t, cid, a.ContainerID())
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("should fail for bad address", func(t *testing.T) {
|
t.Run("should fail for bad address", func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue