Documentation ¶
Index ¶
- Variables
- func CopyOptions(i Info) []string
- func CopyPublicKey(i Info) []byte
- func SetOptionsCopy(i *Info, opts []string)
- func SetPublicKeyCopy(i *Info, key []byte) error
- func StatusToUint64(s Status) uint64
- type Info
- func (i Info) Address() string
- func (i Info) Capacity() uint64
- func (i Info) Options() []string
- func (i Info) Price() uint64
- func (i Info) PublicKey() []byte
- func (i *Info) SetAddress(v string)
- func (i *Info) SetOptions(v []string)
- func (i *Info) SetPublicKey(v []byte)
- func (i *Info) SetStatus(v Status)
- func (i Info) Status() Status
- type Status
Constants ¶
This section is empty.
Variables ¶
var ErrNilInfo = errors.New("node info is nil")
ErrNilInfo is returned by functions that expect a non-nil Info pointer, but received nil.
Functions ¶
func CopyOptions ¶
CopyOptions returns the copy of node options list.
Changing the result is safe and does not affect the node info.
func CopyPublicKey ¶
CopyPublicKey returns the copy of node public key.
Changing the result is safe and does not affect the node info.
func SetOptionsCopy ¶
SetOptionsCopy copies option list and sets the copy as node options list.
Subsequent changing the source slice is safe and does not affect node info.
SetOptionsCopy does nothing if Info is nil.
func SetPublicKeyCopy ¶
SetPublicKeyCopy copies public key and sets the copy as node public key.
Subsequent changing the source slice is safe and does not affect node info.
Returns ErrNilInfo on nil node info.
func StatusToUint64 ¶
StatusToUint64 converts Status value to builtin uint64.
Try to avoid direct cast for better portability.
Types ¶
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
Info represents the information about NeoFS storage node.
func (Info) Address ¶
Address returns node network address.
Address format is dictated by application architecture.
func (Info) Options ¶
Options returns node option list.
Changing the result is unsafe and affects the node info. In order to prevent state mutations, use CopyOptions.
Option format is dictated by application architecture.
func (Info) Price ¶
Price parses node options and returns the price in 1e-8*GAS/Megabyte per month.
User sets the price in GAS/Terabyte per month.
func (Info) PublicKey ¶
PublicKey returns node public key in a binary format.
Changing the result is unsafe and affects the node info. In order to prevent state mutations, use CopyPublicKey.
Key format is dictated by application architecture.
func (*Info) SetOptions ¶
SetOptions sets node option list.
Subsequent changing the source slice is unsafe and affects node info. In order to prevent state mutations, use SetOptionsCopy.
func (*Info) SetPublicKey ¶
SetPublicKey sets node public key in a binary format.
Subsequent changing the source slice is unsafe and affects node info. In order to prevent state mutations, use SetPublicKeyCopy.
type Status ¶
type Status uint64
Status represents a node status bits.
func StatusFromUint64 ¶
StatusFromUint64 converts builtin uint64 value to Status.
Try to avoid direct cast for better portability.