container

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (c *Client) Get(args GetArgs) (*GetValues, error)

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) Put

func (c *Client) Put(args PutArgs) error

Put invokes the call of put 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.

func (*EACLArgs) SetCID

func (g *EACLArgs) SetCID(v []byte)

SetCID sets the container identifier in a binary format.

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.

func (*GetArgs) SetCID

func (g *GetArgs) SetCID(v []byte)

SetCID sets the container identifier in a binary format.

type GetValues

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

GetValues groups the stack parameters returned by get container test invoke.

func (*GetValues) Container

func (g *GetValues) Container() []byte

Container returns the container in a 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

func (l *ListArgs) SetOwnerID(v []byte)

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

func WithDeleteMethod(n string) Option

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

func WithEACLMethod(n string) Option

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

func WithGetMethod(n string) Option

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

func WithListMethod(n string) Option

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

func WithPutMethod(n string) Option

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

func WithSetEACLMethod(n string) Option

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

func (p *PutArgs) SetContainer(v []byte)

SetContainer sets the container structure in a binary format.

func (*PutArgs) SetPublicKey added in v0.12.0

func (p *PutArgs) SetPublicKey(v []byte)

SetPublicKey sets the public key of container owner in a binary format.

func (*PutArgs) SetSignature

func (p *PutArgs) SetSignature(v []byte)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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