forked from TrueCloudLab/frostfs-api-go
Merge pull request #55 from nspcc-dev/object-response-set-epoch
Implement Epoch and Version setters on ResponseMetaHeader
This commit is contained in:
commit
fb0c724201
2 changed files with 20 additions and 0 deletions
|
@ -62,6 +62,12 @@ const (
|
||||||
ErrIncorrectTTL = internal.Error("incorrect ttl")
|
ErrIncorrectTTL = internal.Error("incorrect ttl")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// SetVersion sets protocol version to ResponseMetaHeader.
|
||||||
|
func (m *ResponseMetaHeader) SetVersion(v uint32) { m.Version = v }
|
||||||
|
|
||||||
|
// SetEpoch sets Epoch to ResponseMetaHeader.
|
||||||
|
func (m *ResponseMetaHeader) SetEpoch(v uint64) { m.Epoch = v }
|
||||||
|
|
||||||
// SetVersion sets protocol version to RequestMetaHeader.
|
// SetVersion sets protocol version to RequestMetaHeader.
|
||||||
func (m *RequestMetaHeader) SetVersion(v uint32) { m.Version = v }
|
func (m *RequestMetaHeader) SetVersion(v uint32) { m.Version = v }
|
||||||
|
|
||||||
|
|
|
@ -88,3 +88,17 @@ func TestMetaRequest(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRequestMetaHeader_SetEpoch(t *testing.T) {
|
||||||
|
m := new(ResponseMetaHeader)
|
||||||
|
epoch := uint64(3)
|
||||||
|
m.SetEpoch(epoch)
|
||||||
|
require.Equal(t, epoch, m.GetEpoch())
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestRequestMetaHeader_SetVersion(t *testing.T) {
|
||||||
|
m := new(ResponseMetaHeader)
|
||||||
|
version := uint32(3)
|
||||||
|
m.SetVersion(version)
|
||||||
|
require.Equal(t, version, m.GetVersion())
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue