Documentation ¶
Index ¶
- Variables
- type AddPeerArgs
- type Client
- func (c *Client) AddPeer(args AddPeerArgs) error
- func (c *Client) InnerRingList(args InnerRingListArgs) (*InnerRingListValues, error)
- func (c *Client) NetMap(args GetNetMapArgs) (*GetNetMapValues, error)
- func (c *Client) NewEpoch(args NewEpochArgs) error
- func (c *Client) UpdateState(args UpdateStateArgs) error
- type GetNetMapArgs
- type GetNetMapValues
- type InnerRingListArgs
- type InnerRingListValues
- type NewEpochArgs
- type Option
- type PeerInfo
- type UpdateStateArgs
Constants ¶
This section is empty.
Variables ¶
var ErrNilClient = errors.New("netmap 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 AddPeerArgs ¶
type AddPeerArgs struct {
// contains filtered or unexported fields
}
AddPeerArgs groups the arguments of add peer invocation call.
func (*AddPeerArgs) SetInfo ¶
func (a *AddPeerArgs) SetInfo(v PeerInfo)
SetInfo sets the peer information.
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 Netmap 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:
- add peer method name: AddPeer;
- new epoch method name: NewEpoch;
- get network map method name: Netmap;
- update state method name: UpdateState;
- inner ring list method name: InnerRingList.
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) AddPeer ¶
func (c *Client) AddPeer(args AddPeerArgs) error
AddPeer invokes the call of add peer method of NeoFS Netmap contract.
func (*Client) InnerRingList ¶
func (c *Client) InnerRingList(args InnerRingListArgs) (*InnerRingListValues, error)
InnerRingList performs the test invoke of inner ring list method of NeoFS Netmap contract.
func (*Client) NetMap ¶
func (c *Client) NetMap(args GetNetMapArgs) (*GetNetMapValues, error)
NetMap performs the test invoke of get network map method of NeoFS Netmap contract.
func (*Client) NewEpoch ¶
func (c *Client) NewEpoch(args NewEpochArgs) error
NewEpoch invokes the call of new epoch method of NeoFS Netmap contract.
func (*Client) UpdateState ¶
func (c *Client) UpdateState(args UpdateStateArgs) error
UpdateState invokes the call of update state method of NeoFS Netmap contract.
type GetNetMapArgs ¶
type GetNetMapArgs struct { }
GetNetMapArgs groups the arguments of get network map test invoke call.
type GetNetMapValues ¶
type GetNetMapValues struct {
// contains filtered or unexported fields
}
GetNetMapValues groups the stack parameters returned by get network map test invoke.
func (GetNetMapValues) Peers ¶
func (g GetNetMapValues) Peers() []PeerInfo
Peers return the list of peers from network map in a binary format.
type InnerRingListArgs ¶
type InnerRingListArgs struct { }
InnerRingListArgs groups the arguments of inner ring list test invoke call.
type InnerRingListValues ¶
type InnerRingListValues struct {
// contains filtered or unexported fields
}
InnerRingListValues groups the stack parameters returned by inner ring list test invoke.
func (InnerRingListValues) KeyList ¶
func (g InnerRingListValues) KeyList() [][]byte
KeyList return the list of IR node keys in a binary format.
type NewEpochArgs ¶
type NewEpochArgs struct {
// contains filtered or unexported fields
}
NewEpochArgs groups the arguments of new epoch invocation call.
func (*NewEpochArgs) SetEpochNumber ¶
func (a *NewEpochArgs) SetEpochNumber(v int64)
SetEpochNumber sets the new epoch number.
type Option ¶
type Option func(*cfg)
Option is a client configuration change function.
func WithAddPeerMethod ¶
WithAddPeerMethod returns a client constructor option that specifies the method name of adding peer operation.
Ignores empty value.
If option not provided, "AddPeer" is used.
func WithInnerRingListMethod ¶
WithInnerRingListMethod returns a client constructor option that specifies the method name of inner ring listing operation.
Ignores empty value.
If option not provided, "InnerRingList" is used.
func WithNetMapMethod ¶
WithNetMapMethod returns a client constructor option that specifies the method name of network map receiving operation.
Ignores empty value.
If option not provided, "Netmap" is used.
func WithNewEpochMethod ¶
WithNewEpochMethod returns a client constructor option that specifies the method name of new epoch operation.
Ignores empty value.
If option not provided, "NewEpoch" is used.
func WithUpdateStateMethod ¶
WithUpdateStateMethod returns a client constructor option that specifies the method name of peer state updating operation.
Ignores empty value.
If option not provided, "UpdateState" is used.
type PeerInfo ¶
type PeerInfo struct {
// contains filtered or unexported fields
}
PeerInfo groups the parameters of new NeoFS peer.
func (PeerInfo) Address ¶
Address returns the peer network address in a binary format.
Address format is dictated by application architecture.
func (PeerInfo) Options ¶
Options returns the peer options in a binary format.
Option format is dictated by application architecture.
func (PeerInfo) PublicKey ¶
PublicKey returns the peer public key in a binary format.
Key format is dictated by application architecture.
func (*PeerInfo) SetAddress ¶
SetAddress sets the peer network address in a binary format.
Address format is dictated by application architecture.
func (*PeerInfo) SetOptions ¶
SetOptions sets the peer options in a binary format.
Option format is dictated by application architecture.
func (*PeerInfo) SetPublicKey ¶
SetPublicKey sets the peer public key in a binary format.
Key format is dictated by application architecture.
type UpdateStateArgs ¶
type UpdateStateArgs struct {
// contains filtered or unexported fields
}
UpdateStateArgs groups the arguments of update state invocation call.
func (*UpdateStateArgs) SetPublicKey ¶
func (u *UpdateStateArgs) SetPublicKey(v []byte)
SetPublicKey sets peer public key in a binary format.
func (*UpdateStateArgs) SetState ¶
func (u *UpdateStateArgs) SetState(v int64)
SetState sets the new peer state.