Documentation ¶
Index ¶
- type Client
- func (x Client) Delete(prm DeletePrm) (*DeleteRes, error)
- func (x *Client) Get(prm GetPrm) (*GetRes, error)
- func (x *Client) Init(prm InitPrm) error
- func (x Client) ManageAdmins(prm ManageAdminsPrm) (*ManageAdminsPrm, error)
- func (x Client) ManageClients(prm ManageClientsPrm) (*ManageClientsRes, error)
- func (x Client) ManageNodes(prm ManageNodesPrm) (*ManageNodesRes, error)
- func (x *Client) NodeAllowed(prm NodeAllowedPrm) (*NodeAllowedRes, error)
- func (x Client) Put(prm PutPrm) (*PutRes, error)
- func (x *Client) UserAllowed(prm UserAllowedPrm) (*UserAllowedRes, error)
- type DeletePrm
- type DeleteRes
- type GetPrm
- type GetRes
- type InitPrm
- type ManageAdminsPrm
- type ManageAdminsRes
- type ManageClientsPrm
- type ManageClientsRes
- type ManageNodesPrm
- type ManageNodesRes
- type Mode
- type NodeAllowedPrm
- type NodeAllowedRes
- type PutPrm
- type PutRes
- type UserAllowedPrm
- type UserAllowedRes
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 ¶
Delete removes subnet though the call of the corresponding method of the Subnet contract.
func (*Client) Get ¶
Get reads the subnet through the call of the corresponding method of the Subnet contract.
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 ¶
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.
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.
type GetRes ¶
type GetRes struct {
// contains filtered or unexported fields
}
GetRes groups the resulting values of Get method of Subnet contract.
type InitPrm ¶
type InitPrm struct {
// contains filtered or unexported fields
}
InitPrm groups parameters of Client's initialization.
func (*InitPrm) SetBaseClient ¶
SetBaseClient sets basic morph client.
func (*InitPrm) SetContractAddress ¶
SetContractAddress sets address of Subnet contract in NeoFS sidechain.
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 ( // NotaryAlphabet makes client to use its internal key for signing the notary requests. NotaryAlphabet Mode // 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 ¶
SetID sets identifier of the created subnet in a binary NeoFS API protocol format.
func (*PutPrm) SetInfo ¶
SetInfo sets information about the created subnet in a binary NeoFS API protocol format.
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.