audit

package
v0.14.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 Audit 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

New creates, initializes and returns the Client instance.

Other values are set according to provided options, or by default:

  • "put audit result" method name: put;
  • "list audit results" method name: list.

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

func (c *Client) GetAuditResult(args GetAuditResultArgs) (*GetAuditResultValue, error)

GetAuditResult invokes the call of "get audit result" method of NeoFS Audit contract.

func (*Client) ListAuditResults

func (c *Client) ListAuditResults(args ListResultsArgs) (*ListResultsValues, error)

ListAuditResults performs the test invoke of "list all audit result IDs" method of NeoFS Audit contract.

func (*Client) ListAuditResultsByCID

func (c *Client) ListAuditResultsByCID(args ListResultsByCIDArgs) (*ListResultsValues, error)

ListAuditResultsByCID performs the test invoke of "list audit result IDs by epoch and CID" method of NeoFS Audit contract.

func (*Client) ListAuditResultsByEpoch

func (c *Client) ListAuditResultsByEpoch(args ListResultsByEpochArgs) (*ListResultsValues, error)

ListAuditResultsByEpoch performs the test invoke of "list audit result IDs by epoch" method of NeoFS Audit contract.

func (*Client) ListAuditResultsByNode

func (c *Client) ListAuditResultsByNode(args ListResultsByNodeArgs) (*ListResultsValues, error)

ListAuditResultsByNode performs the test invoke of "list audit result IDs by epoch, CID, and node key" method of NeoFS Audit contract.

func (*Client) PutAuditResult

func (c *Client) PutAuditResult(args PutAuditResultArgs) error

PutAuditResult invokes the call of "put audit result" method of NeoFS Audit contract.

type GetAuditResultArgs

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

GetAuditResultArgs groups the arguments of "get audit result" invocation call.

func (*GetAuditResultArgs) SetID

func (g *GetAuditResultArgs) SetID(id []byte)

SetID sets audit result ID generated by audit contract.

type GetAuditResultValue

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

GetAuditResultValue groups the stack parameters returned by "get audit result" test invoke.

func (*GetAuditResultValue) Result

func (v *GetAuditResultValue) Result() []byte

Result returns audit result structure in binary format.

type ListResultsArgs

type ListResultsArgs struct{}

ListResultsArgs groups the arguments of "list all audit result IDs" test invoke call.

type ListResultsByCIDArgs

type ListResultsByCIDArgs struct {
	ListResultsByEpochArgs
	// contains filtered or unexported fields
}

ListResultsByCIDArgs groups the arguments of "list audit result IDs by epoch and CID" test invoke call.

func (*ListResultsByCIDArgs) SetCID

func (v *ListResultsByCIDArgs) SetCID(cid []byte)

SetCID sets container ID of listing audit results.

type ListResultsByEpochArgs

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

ListResultsByEpochArgs groups the arguments of "list audit result IDs by epoch" test invoke call.

func (*ListResultsByEpochArgs) SetEpoch

func (v *ListResultsByEpochArgs) SetEpoch(epoch int64)

SetEpoch sets epoch of listing audit results.

type ListResultsByNodeArgs

type ListResultsByNodeArgs struct {
	ListResultsByCIDArgs
	// contains filtered or unexported fields
}

ListResultsByNodeArgs groups the arguments of "list audit result IDs by epoch, CID, and node key" test invoke call.

func (*ListResultsByNodeArgs) SetNodeKey

func (v *ListResultsByNodeArgs) SetNodeKey(key []byte)

SetNodeKey sets public key of node that produced listing audit results.

type ListResultsValues

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

ListResultsValues groups the stack parameters returned by "list audit results" test invoke.

func (*ListResultsValues) RawResults

func (v *ListResultsValues) RawResults() [][]byte

RawResults returns list of audit result IDs in a binary format.

type Option

type Option func(*cfg)

Option is a client configuration change function.

func WithGetAuditResultMethod

func WithGetAuditResultMethod(n string) Option

WithGetAuditResultMethod returns a client constructor option that specifies the "get audit result" method name.

Ignores empty value.

func WithListByCIDResultsMethod

func WithListByCIDResultsMethod(n string) Option

WithListByCIDResultsMethod returns a client constructor option that specifies the "list audit result IDs by epoch and CID" method name.

Ignores empty value.

func WithListByEpochResultsMethod

func WithListByEpochResultsMethod(n string) Option

WithListByEpochResultsMethod returns a client constructor option that specifies the "list audit result IDs by epoch" method name.

Ignores empty value.

func WithListByNodeResultsMethod

func WithListByNodeResultsMethod(n string) Option

WithListByNodeResultsMethod returns a client constructor option that specifies the "list audit result IDs by epoch, CID, and node key" method name.

Ignores empty value.

func WithListResultsMethod

func WithListResultsMethod(n string) Option

WithListResultsMethod returns a client constructor option that specifies the "list all audit result IDs" method name.

Ignores empty value.

func WithPutAuditResultMethod

func WithPutAuditResultMethod(n string) Option

WithPutAuditResultMethod returns a client constructor option that specifies the "put audit result" method name.

Ignores empty value.

type PutAuditResultArgs

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

PutAuditResultArgs groups the arguments of "put audit result" invocation call.

func (*PutAuditResultArgs) SetRawResult

func (g *PutAuditResultArgs) SetRawResult(v []byte)

SetRawResult sets audit result structure in NeoFS API-compatible binary representation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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