client

package
v1.20.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const TZSize = 64

Variables

This section is empty.

Functions

This section is empty.

Types

type CallOption

type CallOption interface {
	// contains filtered or unexported methods
}

func WithBearer

func WithBearer(token *token.BearerToken) CallOption

func WithEpoch

func WithEpoch(epoch uint64) CallOption

func WithSession

func WithSession(token *token.SessionToken) CallOption

func WithTTL

func WithTTL(ttl uint32) CallOption

func WithXHeader

func WithXHeader(x *pkg.XHeader) CallOption

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(key *ecdsa.PrivateKey, opts ...Option) (*Client, error)

func (*Client) AttachBearerToken

func (c *Client) AttachBearerToken(token *token.BearerToken)

AttachBearerToken attaches bearer token to client.

Provided bearer is attached to all requests without WithBearer option. Use WithBearer(nil) option in order to send request without bearer token.

func (*Client) AttachSessionToken

func (c *Client) AttachSessionToken(token *token.SessionToken)

AttachSessionToken attaches session token to client.

Provided token is attached to all requests without WithSession option. Use WithSession(nil) option in order to send request without session token.

func (Client) CreateSession

func (c Client) CreateSession(ctx context.Context, expiration uint64, opts ...CallOption) (*token.SessionToken, error)

func (Client) DeleteContainer

func (c Client) DeleteContainer(ctx context.Context, id *container.ID, opts ...CallOption) error

func (*Client) DeleteObject

func (c *Client) DeleteObject(ctx context.Context, p *DeleteObjectParams, opts ...CallOption) error

func (Client) EndpointInfo

func (c Client) EndpointInfo(ctx context.Context, opts ...CallOption) (*netmap.NodeInfo, error)

EndpointInfo returns attributes, address and public key of the node, specified 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 (Client) Epoch

func (c Client) Epoch(ctx context.Context, opts ...CallOption) (uint64, error)

Epoch returns the epoch number from the local state of the remote host.

func (Client) GetBalance

func (c Client) GetBalance(ctx context.Context, owner *owner.ID, opts ...CallOption) (*accounting.Decimal, error)

func (Client) GetContainer

func (c Client) GetContainer(ctx context.Context, id *container.ID, opts ...CallOption) (*container.Container, error)

func (Client) GetEACL

func (c Client) GetEACL(ctx context.Context, id *container.ID, opts ...CallOption) (*eacl.Table, error)

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, p *GetObjectParams, opts ...CallOption) (*object.Object, error)

func (*Client) GetObjectHeader

func (c *Client) GetObjectHeader(ctx context.Context, p *ObjectHeaderParams, opts ...CallOption) (*object.Object, error)

func (Client) GetSelfBalance

func (c Client) GetSelfBalance(ctx context.Context, opts ...CallOption) (*accounting.Decimal, error)

func (Client) ListContainers

func (c Client) ListContainers(ctx context.Context, owner *owner.ID, opts ...CallOption) ([]*container.ID, error)

func (Client) ListSelfContainers

func (c Client) ListSelfContainers(ctx context.Context, opts ...CallOption) ([]*container.ID, error)

func (*Client) ObjectPayloadRangeData

func (c *Client) ObjectPayloadRangeData(ctx context.Context, p *RangeDataParams, opts ...CallOption) ([]byte, error)

func (*Client) ObjectPayloadRangeSHA256

func (c *Client) ObjectPayloadRangeSHA256(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][sha256.Size]byte, error)

func (*Client) ObjectPayloadRangeTZ

func (c *Client) ObjectPayloadRangeTZ(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][TZSize]byte, error)

func (Client) PutContainer

func (c Client) PutContainer(ctx context.Context, cnr *container.Container, opts ...CallOption) (*container.ID, error)

func (*Client) PutObject

func (c *Client) PutObject(ctx context.Context, p *PutObjectParams, opts ...CallOption) (*object.ID, error)

func (*Client) SearchObject

func (c *Client) SearchObject(ctx context.Context, p *SearchObjectParams, opts ...CallOption) ([]*object.ID, error)

func (Client) SetEACL

func (c Client) SetEACL(ctx context.Context, eacl *eacl.Table, opts ...CallOption) error

type DeleteObjectParams

type DeleteObjectParams struct {
	// contains filtered or unexported fields
}

func (*DeleteObjectParams) WithAddress

type GetObjectParams

type GetObjectParams struct {
	// contains filtered or unexported fields
}

func (*GetObjectParams) WithAddress

func (p *GetObjectParams) WithAddress(v *object.Address) *GetObjectParams

func (*GetObjectParams) WithPayloadWriter

func (p *GetObjectParams) WithPayloadWriter(w io.Writer) *GetObjectParams

type ObjectHeaderParams

type ObjectHeaderParams struct {
	// contains filtered or unexported fields
}

func (*ObjectHeaderParams) WithAddress

func (*ObjectHeaderParams) WithAllFields

func (p *ObjectHeaderParams) WithAllFields() *ObjectHeaderParams

func (*ObjectHeaderParams) WithMainFields

func (p *ObjectHeaderParams) WithMainFields() *ObjectHeaderParams

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithAddress

func WithAddress(addr string) Option

func WithGRPCConnection

func WithGRPCConnection(grpcConn *grpc.ClientConn) Option

type PutObjectParams

type PutObjectParams struct {
	// contains filtered or unexported fields
}

func (*PutObjectParams) WithObject

func (p *PutObjectParams) WithObject(v *object.Object) *PutObjectParams

func (*PutObjectParams) WithPayloadReader

func (p *PutObjectParams) WithPayloadReader(v io.Reader) *PutObjectParams

type RangeChecksumParams

type RangeChecksumParams struct {
	// contains filtered or unexported fields
}

func (*RangeChecksumParams) WithAddress

func (*RangeChecksumParams) WithRangeList

func (p *RangeChecksumParams) WithRangeList(rs ...*object.Range) *RangeChecksumParams

func (*RangeChecksumParams) WithSalt

func (p *RangeChecksumParams) WithSalt(v []byte) *RangeChecksumParams

type RangeDataParams

type RangeDataParams struct {
	// contains filtered or unexported fields
}

func (*RangeDataParams) WithAddress

func (p *RangeDataParams) WithAddress(v *object.Address) *RangeDataParams

func (*RangeDataParams) WithDataWriter

func (p *RangeDataParams) WithDataWriter(v io.Writer) *RangeDataParams

func (*RangeDataParams) WithRange

func (p *RangeDataParams) WithRange(v *object.Range) *RangeDataParams

type SearchObjectParams

type SearchObjectParams struct {
	// contains filtered or unexported fields
}

func (*SearchObjectParams) WithContainerID

func (p *SearchObjectParams) WithContainerID(v *container.ID) *SearchObjectParams

func (*SearchObjectParams) WithSearchFilters

func (p *SearchObjectParams) WithSearchFilters(v object.SearchFilters) *SearchObjectParams

type TransportInfo

type TransportInfo struct {
	Version  *pkg.Version
	Protocol TransportProtocol
}

type TransportProtocol

type TransportProtocol uint32
const (
	Unknown TransportProtocol = iota
	GRPC
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL