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) List(args ListArgs) (*ListValues, error)
- func (c *Client) Put(args PutArgs) error
- func (c *Client) SetEACL(args SetEACLArgs) error
- type DeleteArgs
- type EACLArgs
- type EACLValues
- type GetArgs
- type GetValues
- type ListArgs
- type ListValues
- type Option
- type PutArgs
- type SetEACLArgs
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.
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) List ¶
func (c *Client) List(args ListArgs) (*ListValues, error)
List performs the test invoke of list container 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.
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) 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) Signature ¶ added in v0.12.0
func (g *EACLValues) Signature() []byte
type GetArgs ¶
type GetArgs struct {
// contains filtered or unexported fields
}
GetArgs groups the arguments of get container test invoke call.
type GetValues ¶
type GetValues struct {
// contains filtered or unexported fields
}
GetValues groups the stack parameters returned by get container test invoke.
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 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 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 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 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.
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) SetSignature ¶
SetSignature sets the container structure owner's signature.
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) SetSignature ¶
func (p *SetEACLArgs) SetSignature(v []byte)
SetSignature sets the eACL table structure owner's signature.