morphsubnet

package
v0.28.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-3.0 Imports: 4 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 represents Subnet contract client.

Client should be preliminary initialized (see Init method).

func (Client) Delete

func (x Client) Delete(prm DeletePrm) (*DeleteRes, error)

Delete removes subnet though the call of the corresponding method of the Subnet contract.

func (*Client) Get

func (x *Client) Get(prm GetPrm) (*GetRes, error)

Get reads the subnet through the call of the corresponding method of the Subnet contract.

func (*Client) Init

func (x *Client) Init(prm InitPrm) error

Init initializes client with specified parameters.

Base client must be set.

func (Client) ManageAdmins

func (x Client) ManageAdmins(prm ManageAdminsPrm) (*ManageAdminsPrm, error)

ManageAdmins manages admin list of the NeoFS subnet through Subnet contract calls.

func (Client) ManageClients

func (x Client) ManageClients(prm ManageClientsPrm) (*ManageClientsRes, error)

ManageClients manages client list of the NeoFS subnet through Subnet contract calls.

func (Client) ManageNodes

func (x Client) ManageNodes(prm ManageNodesPrm) (*ManageNodesRes, error)

ManageNodes manages node list of the NeoFS subnet through Subnet contract calls.

func (*Client) NodeAllowed

func (x *Client) NodeAllowed(prm NodeAllowedPrm) (*NodeAllowedRes, error)

NodeAllowed checks if the node is included in the subnetwork.

func (Client) Put

func (x Client) Put(prm PutPrm) (*PutRes, error)

Put creates subnet though the call of the corresponding method of the Subnet contract.

func (*Client) UserAllowed

func (x *Client) UserAllowed(prm UserAllowedPrm) (*UserAllowedRes, error)

UserAllowed checks if the user has access to the subnetwork.

type DeletePrm

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

DeletePrm groups parameters of Delete method of Subnet contract.

func (*DeletePrm) SetID

func (x *DeletePrm) SetID(id []byte)

SetID sets identifier of the subnet to be removed in a binary NeoFS API protocol format.

func (*DeletePrm) SetTxHash

func (x *DeletePrm) SetTxHash(hash util.Uint256)

SetTxHash sets hash of the transaction which spawned the notification. Ignore this parameter for new requests.

type DeleteRes

type DeleteRes struct{}

DeleteRes groups the resulting values of Delete method of Subnet contract.

type GetPrm

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

GetPrm groups parameters of Get method of Subnet contract.

func (*GetPrm) SetID

func (x *GetPrm) SetID(id []byte)

SetID sets identifier of the subnet to be read in a binary NeoFS API protocol format.

type GetRes

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

GetRes groups the resulting values of Get method of Subnet contract.

func (GetRes) Info

func (x GetRes) Info() []byte

Info returns information about the subnet in a binary format of NeoFS API protocol.

type InitPrm

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

InitPrm groups parameters of Client's initialization.

func (*InitPrm) SetBaseClient

func (x *InitPrm) SetBaseClient(base *client.Client)

SetBaseClient sets basic morph client.

func (*InitPrm) SetContractAddress

func (x *InitPrm) SetContractAddress(addr util.Uint160)

SetContractAddress sets address of Subnet contract in NeoFS sidechain.

func (*InitPrm) SetMode

func (x *InitPrm) SetMode(mode Mode)

SetMode makes client to work with non-notary sidechain. By default, NonNotary is used.

type ManageAdminsPrm

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

ManageAdminsPrm groups parameters of administer methods of Subnet contract.

Zero value adds node admin. Subnet, key and group must be specified via setters.

func (*ManageAdminsPrm) SetAdmin

func (x *ManageAdminsPrm) SetAdmin(key []byte)

SetAdmin sets admin's public key in a binary format.

func (*ManageAdminsPrm) SetClient

func (x *ManageAdminsPrm) SetClient()

SetClient switches to client admin. By default, node admin is modified.

func (*ManageAdminsPrm) SetGroup

func (x *ManageAdminsPrm) SetGroup(id []byte)

SetGroup sets identifier of the client group in a binary NeoFS API protocol format. Makes sense only for client admins (see ManageAdminsPrm.SetClient).

func (*ManageAdminsPrm) SetRemove

func (x *ManageAdminsPrm) SetRemove()

SetRemove marks admin to be removed. By default, admin is added.

func (*ManageAdminsPrm) SetSubnet

func (x *ManageAdminsPrm) SetSubnet(id []byte)

SetSubnet sets identifier of the subnet in a binary NeoFS API protocol format.

type ManageAdminsRes

type ManageAdminsRes struct{}

ManageAdminsRes groups the resulting values of node administer methods of Subnet contract.

type ManageClientsPrm

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

ManageClientsPrm groups parameters of client management in Subnet contract.

Zero value adds subnet client. Subnet, group and client ID must be specified via setters.

func (*ManageClientsPrm) SetClient

func (x *ManageClientsPrm) SetClient(id []byte)

SetClient sets client's user ID in a binary NeoFS API protocol format.

func (*ManageClientsPrm) SetGroup

func (x *ManageClientsPrm) SetGroup(id []byte)

SetGroup sets identifier of the client group in a binary NeoFS API protocol format.

func (*ManageClientsPrm) SetRemove

func (x *ManageClientsPrm) SetRemove()

SetRemove marks client to be removed. By default, client is added.

func (*ManageClientsPrm) SetSubnet

func (x *ManageClientsPrm) SetSubnet(id []byte)

SetSubnet sets identifier of the subnet in a binary NeoFS API protocol format.

type ManageClientsRes

type ManageClientsRes struct{}

ManageClientsRes groups the resulting values of client management methods of Subnet contract.

type ManageNodesPrm

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

ManageNodesPrm groups parameters of node management in Subnet contract.

Zero value adds node to subnet. Subnet and node IDs must be specified via setters.

func (*ManageNodesPrm) SetNode

func (x *ManageNodesPrm) SetNode(id []byte)

SetNode sets node's public key in a binary format.

func (*ManageNodesPrm) SetRemove

func (x *ManageNodesPrm) SetRemove()

SetRemove marks node to be removed. By default, node is added.

func (*ManageNodesPrm) SetSubnet

func (x *ManageNodesPrm) SetSubnet(id []byte)

SetSubnet sets identifier of the subnet in a binary NeoFS API protocol format.

type ManageNodesRes

type ManageNodesRes struct{}

ManageNodesRes groups the resulting values of node management methods of Subnet contract.

type Mode

type Mode uint8

Mode regulates client work mode.

const (

	// NonNotary makes client to work in non-notary environment.
	NonNotary Mode

	// NotaryAlphabet makes client to use its internal key for signing the notary requests.
	NotaryAlphabet

	// NotaryNonAlphabet makes client to not use its internal key for signing the notary requests.
	NotaryNonAlphabet
)

type NodeAllowedPrm

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

NodeAllowedPrm groups parameters of NodeAllowed method of Subnet contract.

func (*NodeAllowedPrm) SetID

func (x *NodeAllowedPrm) SetID(id []byte)

SetID sets identifier of the subnet of the node in a binary NeoFS API protocol format.

func (*NodeAllowedPrm) SetNode

func (x *NodeAllowedPrm) SetNode(id []byte)

SetNode sets public key of the node that is being checked.

type NodeAllowedRes

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

NodeAllowedRes groups the resulting values of NodeAllowed method of Subnet contract.

func (NodeAllowedRes) Allowed

func (x NodeAllowedRes) Allowed() bool

Allowed returns true iff the node is allowed to enter the subnet.

type PutPrm

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

PutPrm groups parameters of Put method of Subnet contract.

func (*PutPrm) SetID

func (x *PutPrm) SetID(id []byte)

SetID sets identifier of the created subnet in a binary NeoFS API protocol format.

func (*PutPrm) SetInfo

func (x *PutPrm) SetInfo(id []byte)

SetInfo sets information about the created subnet in a binary NeoFS API protocol format.

func (*PutPrm) SetOwner

func (x *PutPrm) SetOwner(id []byte)

SetOwner sets identifier of the subnet owner in a binary NeoFS API protocol format.

func (*PutPrm) SetTxHash

func (x *PutPrm) SetTxHash(hash util.Uint256)

SetTxHash sets hash of the transaction which spawned the notification. Ignore this parameter for new requests.

type PutRes

type PutRes struct{}

PutRes groups the resulting values of Put method of Subnet contract.

type UserAllowedPrm

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

UserAllowedPrm groups parameters of UserAllowed method of Subnet contract.

func (*UserAllowedPrm) SetClient

func (x *UserAllowedPrm) SetClient(id []byte)

SetClient sets owner ID of the client that is being checked in a binary NeoFS API protocol format.

func (*UserAllowedPrm) SetID

func (x *UserAllowedPrm) SetID(id []byte)

SetID sets identifier of the subnet in a binary NeoFS API protocol format.

type UserAllowedRes

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

UserAllowedRes groups the resulting values of UserAllowed method of Subnet contract.

func (UserAllowedRes) Allowed

func (x UserAllowedRes) Allowed() bool

Allowed returns true iff the client is allowed to create containers in the subnet.

Jump to

Keyboard shortcuts

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