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
|
@ -25,7 +25,7 @@ func (c Client) GetSelfBalance(ctx context.Context, opts ...CallOption) (*accoun
|
|||
|
||||
func (c Client) GetBalance(ctx context.Context, owner *owner.ID, opts ...CallOption) (*accounting.Decimal, error) {
|
||||
// check remote node version
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.getBalanceV2(ctx, owner, opts...)
|
||||
default:
|
||||
|
|
|
@ -27,7 +27,7 @@ func (c delContainerSignWrapper) SignedDataSize() int {
|
|||
}
|
||||
|
||||
func (c Client) PutContainer(ctx context.Context, cnr *container.Container, opts ...CallOption) (*container.ID, error) {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.putContainerV2(ctx, cnr, opts...)
|
||||
default:
|
||||
|
@ -36,7 +36,7 @@ func (c Client) PutContainer(ctx context.Context, cnr *container.Container, opts
|
|||
}
|
||||
|
||||
func (c Client) GetContainer(ctx context.Context, id *container.ID, opts ...CallOption) (*container.Container, error) {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.getContainerV2(ctx, id, opts...)
|
||||
default:
|
||||
|
@ -45,7 +45,7 @@ func (c Client) GetContainer(ctx context.Context, id *container.ID, opts ...Call
|
|||
}
|
||||
|
||||
func (c Client) ListContainers(ctx context.Context, owner *owner.ID, opts ...CallOption) ([]*container.ID, error) {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.listContainerV2(ctx, owner, opts...)
|
||||
default:
|
||||
|
@ -66,7 +66,7 @@ func (c Client) ListSelfContainers(ctx context.Context, opts ...CallOption) ([]*
|
|||
}
|
||||
|
||||
func (c Client) DeleteContainer(ctx context.Context, id *container.ID, opts ...CallOption) error {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.delContainerV2(ctx, id, opts...)
|
||||
default:
|
||||
|
@ -75,7 +75,7 @@ func (c Client) DeleteContainer(ctx context.Context, id *container.ID, opts ...C
|
|||
}
|
||||
|
||||
func (c Client) GetEACL(ctx context.Context, id *container.ID, opts ...CallOption) (*eacl.Table, error) {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.getEACLV2(ctx, id, opts...)
|
||||
default:
|
||||
|
@ -84,7 +84,7 @@ func (c Client) GetEACL(ctx context.Context, id *container.ID, opts ...CallOptio
|
|||
}
|
||||
|
||||
func (c Client) SetEACL(ctx context.Context, eacl *eacl.Table, opts ...CallOption) error {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.setEACLV2(ctx, eacl, opts...)
|
||||
default:
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
// in client constructor via address or open connection. This can be used as a
|
||||
// health check to see if node is alive and responses to requests.
|
||||
func (c Client) EndpointInfo(ctx context.Context, opts ...CallOption) (*netmap.NodeInfo, error) {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
resp, err := c.endpointInfoV2(ctx, opts...)
|
||||
if err != nil {
|
||||
|
@ -29,7 +29,7 @@ func (c Client) EndpointInfo(ctx context.Context, opts ...CallOption) (*netmap.N
|
|||
|
||||
// Epoch returns the epoch number from the local state of the remote host.
|
||||
func (c Client) Epoch(ctx context.Context, opts ...CallOption) (uint64, error) {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
resp, err := c.endpointInfoV2(ctx, opts...)
|
||||
if err != nil {
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
func (c Client) CreateSession(ctx context.Context, expiration uint64, opts ...CallOption) (*token.SessionToken, error) {
|
||||
switch c.remoteNode.Version.GetMajor() {
|
||||
switch c.remoteNode.Version.Major() {
|
||||
case 2:
|
||||
return c.createSessionV2(ctx, expiration, opts...)
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue