Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) Delete(args DeleteArgs) error
- func (c *Client) EACL(args EACLArgs) (*EACLValues, error)
- func (c *Client) Get(args GetArgs) (*GetValues, error)
- func (c *Client) GetContainerSize(args GetSizeArgs) (*GetSizeValues, error)
- func (c *Client) List(args ListArgs) (*ListValues, error)
- func (c *Client) ListSizes(args ListSizesArgs) (*ListSizesValues, error)
- func (c *Client) Put(args PutArgs) error
- func (c *Client) PutSize(args PutSizeArgs) error
- func (c *Client) SetEACL(args SetEACLArgs) error
- func (c *Client) StartEstimation(args StartEstimation) error
- func (c *Client) StopEstimation(args StopEstimation) error
- type DeleteArgs
- type EACLArgs
- type EACLValues
- type Estimation
- type Estimations
- type GetArgs
- type GetSizeArgs
- type GetSizeValues
- type GetValues
- type ListArgs
- type ListSizesArgs
- type ListSizesValues
- type ListValues
- type Option
- func WithDeleteMethod(n string) Option
- func WithEACLMethod(n string) Option
- func WithGetMethod(n string) Option
- func WithGetSizeMethod(n string) Option
- func WithListMethod(n string) Option
- func WithListSizesMethod(n string) Option
- func WithPutMethod(n string) Option
- func WithPutSizeMethod(n string) Option
- func WithSetEACLMethod(n string) Option
- func WithStartEstimationMethod(n string) Option
- func WithStopEstimationMethod(n string) Option
- type PutArgs
- type PutSizeArgs
- type SetEACLArgs
- type StartEstimation
- type StopEstimation
Constants ¶
This section is empty.
Variables ¶
var ErrNilClient = errors.New("container contract client is nil")
ErrNilClient is returned by functions that expect a non-nil Client pointer, but received nil.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper over StaticClient which makes calls with the names and arguments of the NeoFS Container contract.
Working client must be created via constructor New. Using the Client that has been created with new(Client) expression (or just declaring a Client variable) is unsafe and can lead to panic.
func New ¶
func New(c *client.StaticClient, opts ...Option) (*Client, error)
New creates, initializes and returns the Client instance.
If StaticClient is nil, client.ErrNilStaticClient is returned.
Other values are set according to provided options, or by default:
- put container method name: Put;
- delete container method name: Delete;
- get container method name: Get;
- list containers method name: List;
- set eACL method name: SetEACL;
- get eACL method name: EACL.
- start estimation method name: startContainerEstimation
- stop estimation method name: stopContainerEstimation
- put container size method name: putContainerSize
- get container size method name: getContainerSize
- list container sizes method name: listContainerSizes
If desired option satisfies the default value, it can be omitted. If multiple options of the same config value are supplied, the option with the highest index in the arguments will be used.
func (*Client) Delete ¶
func (c *Client) Delete(args DeleteArgs) error
Delete invokes the call of delete container method of NeoFS Container contract.
func (*Client) EACL ¶
func (c *Client) EACL(args EACLArgs) (*EACLValues, error)
EACL performs the test invoke of get eACL method of NeoFS Container contract.
func (*Client) Get ¶
Get performs the test invoke of get container method of NeoFS Container contract.
func (*Client) GetContainerSize ¶ added in v0.15.0
func (c *Client) GetContainerSize(args GetSizeArgs) (*GetSizeValues, error)
GetContainerSize performs the test invoke of "get container size" method of NeoFS Container contract.
func (*Client) List ¶
func (c *Client) List(args ListArgs) (*ListValues, error)
List performs the test invoke of list container method of NeoFS Container contract.
func (*Client) ListSizes ¶ added in v0.15.0
func (c *Client) ListSizes(args ListSizesArgs) (*ListSizesValues, error)
List performs the test invoke of "list container sizes" method of NeoFS Container contract.
func (*Client) PutSize ¶ added in v0.15.0
func (c *Client) PutSize(args PutSizeArgs) error
PutSize invokes the call of put container size method of NeoFS Container contract.
func (*Client) SetEACL ¶
func (c *Client) SetEACL(args SetEACLArgs) error
SetEACL invokes the call of set eACL method of NeoFS Container contract.
func (*Client) StartEstimation ¶ added in v0.15.0
func (c *Client) StartEstimation(args StartEstimation) error
func (*Client) StopEstimation ¶ added in v0.15.0
func (c *Client) StopEstimation(args StopEstimation) error
type DeleteArgs ¶
type DeleteArgs struct {
// contains filtered or unexported fields
}
DeleteArgs groups the arguments of delete container invocation call.
func (*DeleteArgs) SetCID ¶
func (p *DeleteArgs) SetCID(v []byte)
SetCID sets the container identifier in a binary format.
func (*DeleteArgs) SetSessionToken ¶ added in v0.21.0
func (p *DeleteArgs) SetSessionToken(v []byte)
SetSessionToken sets token of the session within which the container was removed in a NeoFS API binary format.
func (*DeleteArgs) SetSignature ¶
func (p *DeleteArgs) SetSignature(v []byte)
SetSignature sets the container identifier owner's signature.
type EACLArgs ¶
type EACLArgs struct {
// contains filtered or unexported fields
}
EACLArgs groups the arguments of get eACL test invoke call.
type EACLValues ¶
type EACLValues struct {
// contains filtered or unexported fields
}
EACLValues groups the stack parameters returned by get eACL test invoke.
func (*EACLValues) EACL ¶
func (g *EACLValues) EACL() []byte
EACL returns the eACL table in a binary format.
func (*EACLValues) PublicKey ¶ added in v0.14.1
func (g *EACLValues) PublicKey() []byte
PublicKey of the signature.
func (*EACLValues) SessionToken ¶ added in v0.21.0
func (g *EACLValues) SessionToken() []byte
SessionToken returns token of the session within which the eACl table was set in a NeoFS API binary format.
func (*EACLValues) Signature ¶ added in v0.12.0
func (g *EACLValues) Signature() []byte
Signature returns RFC-6979 signature of extended ACL table.
type Estimation ¶ added in v0.15.0
type Estimations ¶ added in v0.15.0
type Estimations struct { ContainerID []byte Estimations []Estimation }
type GetArgs ¶
type GetArgs struct {
// contains filtered or unexported fields
}
GetArgs groups the arguments of get container test invoke call.
type GetSizeArgs ¶ added in v0.15.0
type GetSizeArgs struct {
// contains filtered or unexported fields
}
GetSizeArgs groups the arguments of "get container size" test invoke call..
func (*GetSizeArgs) SetID ¶ added in v0.15.0
func (p *GetSizeArgs) SetID(v []byte)
SetID sets identifier of the container estimation.
type GetSizeValues ¶ added in v0.15.0
type GetSizeValues struct {
// contains filtered or unexported fields
}
GetSizeValues groups the stack items returned by "get container size" test invoke.
func (*GetSizeValues) Estimations ¶ added in v0.15.0
func (v *GetSizeValues) Estimations() Estimations
Estimations returns list of the container load estimations.
type GetValues ¶
type GetValues struct {
// contains filtered or unexported fields
}
GetValues groups the stack parameters returned by get container test invoke.
func (*GetValues) SessionToken ¶ added in v0.21.0
SessionToken returns token of the session within which the container was created in a NeoFS API binary format.
type ListArgs ¶
type ListArgs struct {
// contains filtered or unexported fields
}
ListArgs groups the arguments of list containers test invoke call.
func (*ListArgs) SetOwnerID ¶
SetOwnerID sets the container owner identifier in a binary format.
type ListSizesArgs ¶ added in v0.15.0
type ListSizesArgs struct {
// contains filtered or unexported fields
}
ListSizesArgs groups the arguments of "list container sizes" test invoke call..
func (*ListSizesArgs) SetEpoch ¶ added in v0.15.0
func (p *ListSizesArgs) SetEpoch(v uint64)
SetEpoch sets the number of the epoch to select the estimations.
type ListSizesValues ¶ added in v0.15.0
type ListSizesValues struct {
// contains filtered or unexported fields
}
ListSizesValues groups the stack items returned by "list container sizes" test invoke.
func (*ListSizesValues) IDList ¶ added in v0.15.0
func (v *ListSizesValues) IDList() [][]byte
Announcements returns list of identifiers of the container load estimations.
type ListValues ¶
type ListValues struct {
// contains filtered or unexported fields
}
ListValues groups the stack parameters returned by list containers test invoke.
func (*ListValues) CIDList ¶
func (l *ListValues) CIDList() [][]byte
CIDList returns the list of container identifiers in a binary format.
type Option ¶
type Option func(*cfg)
Option is a client configuration change function.
func WithDeleteMethod ¶
WithDeleteMethod returns a client constructor option that specifies the method name of container removal operation.
Ignores empty value.
If option not provided, "Delete" is used.
func WithEACLMethod ¶
WithEACLMethod returns a client constructor option that specifies the method name of eACL receiving operation.
Ignores empty value.
If option not provided, "EACL" is used.
func WithGetMethod ¶
WithGetMethod returns a client constructor option that specifies the method name of container receiving operation.
Ignores empty value.
If option not provided, "Get" is used.
func WithGetSizeMethod ¶ added in v0.15.0
WithGetSizeMethod returns a client constructor option that specifies the method name of "get container size" operation.
Ignores empty value.
If option not provided, "getContainerSize" is used.
func WithListMethod ¶
WithListMethod returns a client constructor option that specifies the method name of container listing operation.
Ignores empty value.
If option not provided, "List" is used.
func WithListSizesMethod ¶ added in v0.15.0
WithListSizesMethod returns a client constructor option that specifies the method name of "list container sizes" operation.
Ignores empty value.
If option not provided, "listContainerSizes" is used.
func WithPutMethod ¶
WithPutMethod returns a client constructor option that specifies the method name of container storing operation.
Ignores empty value.
If option not provided, "Put" is used.
func WithPutSizeMethod ¶ added in v0.15.0
WithPutSizeMethod returns a client constructor option that specifies the method name of "put container size" operation.
Ignores empty value.
If option not provided, "putContainerSize" is used.
func WithSetEACLMethod ¶
WithSetEACLMethod returns a client constructor option that specifies the method name of eACL storing operation.
Ignores empty value.
If option not provided, "SetEACL" is used.
func WithStartEstimationMethod ¶ added in v0.15.0
WithStartEstimationMethod returns a client constructor option that specifies the method name of vote to start container size estimation.
Ignores empty value.
If option not provided, "startContainerEstimation" is used.
func WithStopEstimationMethod ¶ added in v0.15.0
WithStopEstimationMethod returns a client constructor option that specifies the method name of vote to stop container size estimation.
Ignores empty value.
If option not provided, "stopContainerEstimation" is used.
type PutArgs ¶
type PutArgs struct {
// contains filtered or unexported fields
}
PutArgs groups the arguments of put container invocation call.
func (*PutArgs) SetContainer ¶
SetContainer sets the container structure in a binary format.
func (*PutArgs) SetPublicKey ¶ added in v0.12.0
SetPublicKey sets the public key of container owner in a binary format.
func (*PutArgs) SetSessionToken ¶ added in v0.21.0
SetSessionToken sets token of the session within which the container was created in a binary format.
func (*PutArgs) SetSignature ¶
SetSignature sets the container structure owner's signature.
type PutSizeArgs ¶ added in v0.15.0
type PutSizeArgs struct {
// contains filtered or unexported fields
}
PutSizeArgs groups the arguments of "put container size" invocation call.
func (*PutSizeArgs) SetContainerID ¶ added in v0.15.0
func (p *PutSizeArgs) SetContainerID(v []byte)
SetContainerID sets identifier of the container being evaluated.
func (*PutSizeArgs) SetEpoch ¶ added in v0.15.0
func (p *PutSizeArgs) SetEpoch(v uint64)
SetEpoch sets the number of the epoch when size was estimated.
func (*PutSizeArgs) SetReporterKey ¶ added in v0.15.0
func (p *PutSizeArgs) SetReporterKey(v []byte)
SetReporterKey ыуеы public key of the storage node that collected size estimation.
func (*PutSizeArgs) SetSize ¶ added in v0.15.0
func (p *PutSizeArgs) SetSize(v uint64)
SetSize sets estimation of the container size.
type SetEACLArgs ¶
type SetEACLArgs struct {
// contains filtered or unexported fields
}
SetEACLArgs groups the arguments of set eACL invocation call.
func (*SetEACLArgs) SetEACL ¶
func (p *SetEACLArgs) SetEACL(v []byte)
SetEACL sets the extended ACL table in a binary format.
func (*SetEACLArgs) SetPublicKey ¶ added in v0.21.0
func (p *SetEACLArgs) SetPublicKey(v []byte)
SetPublicKey sets public key related to table signature.
func (*SetEACLArgs) SetSessionToken ¶ added in v0.21.0
func (p *SetEACLArgs) SetSessionToken(v []byte)
SetSessionToken sets token of the session within which the eACL table was set in a binary format.
func (*SetEACLArgs) SetSignature ¶
func (p *SetEACLArgs) SetSignature(v []byte)
SetSignature sets the eACL table structure owner's signature.
type StartEstimation ¶ added in v0.15.0
type StartEstimation struct {
// contains filtered or unexported fields
}
func (*StartEstimation) SetEpoch ¶ added in v0.15.0
func (e *StartEstimation) SetEpoch(v int64)
type StopEstimation ¶ added in v0.15.0
type StopEstimation struct {
// contains filtered or unexported fields
}
func (*StopEstimation) SetEpoch ¶ added in v0.15.0
func (e *StopEstimation) SetEpoch(v int64)