forked from TrueCloudLab/frostfs-api-go
[#197] sdk: Rename getters of Version type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f886d75560
commit
2bcbd48972
7 changed files with 30 additions and 30 deletions
|
@ -144,7 +144,7 @@ func (p *PutObjectParams) WithPayloadReader(v io.Reader) *PutObjectParams {
|
|||
|
||||
func (c *Client) PutObject(ctx context.Context, p *PutObjectParams, opts ...CallOption) (*object.ID, error) {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.putObjectV2(ctx, p, opts...)
|
||||
default:
|
||||
|
@ -264,7 +264,7 @@ func (p *DeleteObjectParams) WithAddress(v *object.Address) *DeleteObjectParams
|
|||
|
||||
func (c *Client) DeleteObject(ctx context.Context, p *DeleteObjectParams, opts ...CallOption) error {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.deleteObjectV2(ctx, p, opts...)
|
||||
default:
|
||||
|
@ -344,7 +344,7 @@ func (p *GetObjectParams) WithPayloadWriter(w io.Writer) *GetObjectParams {
|
|||
|
||||
func (c *Client) GetObject(ctx context.Context, p *GetObjectParams, opts ...CallOption) (*object.Object, error) {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.getObjectV2(ctx, p, opts...)
|
||||
default:
|
||||
|
@ -477,7 +477,7 @@ func (p *ObjectHeaderParams) WithMainFields() *ObjectHeaderParams {
|
|||
|
||||
func (c *Client) GetObjectHeader(ctx context.Context, p *ObjectHeaderParams, opts ...CallOption) (*object.Object, error) {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.getObjectHeaderV2(ctx, p, opts...)
|
||||
default:
|
||||
|
@ -610,7 +610,7 @@ func (p *RangeDataParams) WithDataWriter(v io.Writer) *RangeDataParams {
|
|||
|
||||
func (c *Client) ObjectPayloadRangeData(ctx context.Context, p *RangeDataParams, opts ...CallOption) ([]byte, error) {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.objectPayloadRangeV2(ctx, p, opts...)
|
||||
default:
|
||||
|
@ -752,7 +752,7 @@ func (c *Client) ObjectPayloadRangeTZ(ctx context.Context, p *RangeChecksumParam
|
|||
|
||||
func (c *Client) objectPayloadRangeHash(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) (interface{}, error) {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.objectPayloadRangeHashV2(ctx, p, opts...)
|
||||
default:
|
||||
|
@ -884,7 +884,7 @@ func (p *SearchObjectParams) WithSearchFilters(v object.SearchFilters) *SearchOb
|
|||
|
||||
func (c *Client) SearchObject(ctx context.Context, p *SearchObjectParams, opts ...CallOption) ([]*object.ID, error) {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.searchObjectV2(ctx, p, opts...)
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue