netmap

package
v1.25.1-0...-2fdc35d Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributesToGRPC

func AttributesToGRPC(as []*Attribute) (res []*netmap.NodeInfo_Attribute)

func ClauseToGRPCMessage

func ClauseToGRPCMessage(n Clause) netmap.Clause

func FiltersToGRPC

func FiltersToGRPC(fs []*Filter) (res []*netmap.Filter)

func NodeStateToGRPCMessage

func NodeStateToGRPCMessage(n NodeState) netmap.NodeInfo_State

func OperationToGRPCMessage

func OperationToGRPCMessage(n Operation) netmap.Operation

func ReplicasToGRPC

func ReplicasToGRPC(rs []*Replica) (res []*netmap.Replica)

func SelectorsToGRPC

func SelectorsToGRPC(ss []*Selector) (res []*netmap.Selector)

Types

type Attribute

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

Attribute of storage node.

func AttributesFromGRPC

func AttributesFromGRPC(as []*netmap.NodeInfo_Attribute) (res []*Attribute, err error)

func (*Attribute) FromGRPCMessage

func (a *Attribute) FromGRPCMessage(m neofsgrpc.Message) error

func (*Attribute) GetKey

func (a *Attribute) GetKey() string

func (*Attribute) GetParents

func (a *Attribute) GetParents() []string

func (*Attribute) GetValue

func (a *Attribute) GetValue() string

func (*Attribute) MarshalJSON

func (a *Attribute) MarshalJSON() ([]byte, error)

func (*Attribute) SetKey

func (a *Attribute) SetKey(v string)

func (*Attribute) SetParents

func (a *Attribute) SetParents(parent []string)

func (*Attribute) SetValue

func (a *Attribute) SetValue(v string)

func (*Attribute) StableMarshal

func (a *Attribute) StableMarshal(buf []byte) ([]byte, error)

func (*Attribute) StableSize

func (a *Attribute) StableSize() (size int)

func (*Attribute) ToGRPCMessage

func (a *Attribute) ToGRPCMessage() neofsgrpc.Message

func (*Attribute) Unmarshal

func (a *Attribute) Unmarshal(data []byte) error

func (*Attribute) UnmarshalJSON

func (a *Attribute) UnmarshalJSON(data []byte) error

type Clause

type Clause uint32

Clause of placement selector.

const (
	UnspecifiedClause Clause = iota
	Same
	Distinct
)

func ClauseFromGRPCMessage

func ClauseFromGRPCMessage(n netmap.Clause) Clause

func (*Clause) FromString

func (x *Clause) FromString(s string) bool

FromString parses Clause from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (Clause) String

func (x Clause) String() string

String returns string representation of Clause.

type Filter

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

func FiltersFromGRPC

func FiltersFromGRPC(fs []*netmap.Filter) (res []*Filter, err error)

func (*Filter) FromGRPCMessage

func (f *Filter) FromGRPCMessage(m neofsgrpc.Message) error

func (*Filter) GetFilters

func (f *Filter) GetFilters() []*Filter

func (*Filter) GetKey

func (f *Filter) GetKey() string

func (*Filter) GetName

func (f *Filter) GetName() string

func (*Filter) GetOp

func (f *Filter) GetOp() Operation

func (*Filter) GetValue

func (f *Filter) GetValue() string

func (*Filter) MarshalJSON

func (f *Filter) MarshalJSON() ([]byte, error)

func (*Filter) SetFilters

func (f *Filter) SetFilters(filters []*Filter)

func (*Filter) SetKey

func (f *Filter) SetKey(key string)

func (*Filter) SetName

func (f *Filter) SetName(name string)

func (*Filter) SetOp

func (f *Filter) SetOp(op Operation)

func (*Filter) SetValue

func (f *Filter) SetValue(value string)

func (*Filter) StableMarshal

func (f *Filter) StableMarshal(buf []byte) ([]byte, error)

func (*Filter) StableSize

func (f *Filter) StableSize() (size int)

func (*Filter) ToGRPCMessage

func (f *Filter) ToGRPCMessage() neofsgrpc.Message

func (*Filter) Unmarshal

func (f *Filter) Unmarshal(data []byte) error

func (*Filter) UnmarshalJSON

func (f *Filter) UnmarshalJSON(data []byte) error

type LocalNodeInfoRequest

type LocalNodeInfoRequest struct {
	session.RequestHeaders
	// contains filtered or unexported fields
}

func (*LocalNodeInfoRequest) FromGRPCMessage

func (l *LocalNodeInfoRequest) FromGRPCMessage(m neofsgrpc.Message) error

func (*LocalNodeInfoRequest) GetBody

func (*LocalNodeInfoRequest) SetBody

func (*LocalNodeInfoRequest) ToGRPCMessage

func (l *LocalNodeInfoRequest) ToGRPCMessage() neofsgrpc.Message

type LocalNodeInfoRequestBody

type LocalNodeInfoRequestBody struct{}

func (*LocalNodeInfoRequestBody) FromGRPCMessage

func (l *LocalNodeInfoRequestBody) FromGRPCMessage(m neofsgrpc.Message) error

func (*LocalNodeInfoRequestBody) StableMarshal

func (l *LocalNodeInfoRequestBody) StableMarshal(buf []byte) ([]byte, error)

func (*LocalNodeInfoRequestBody) StableSize

func (l *LocalNodeInfoRequestBody) StableSize() (size int)

func (*LocalNodeInfoRequestBody) ToGRPCMessage

func (l *LocalNodeInfoRequestBody) ToGRPCMessage() neofsgrpc.Message

func (*LocalNodeInfoRequestBody) Unmarshal

func (l *LocalNodeInfoRequestBody) Unmarshal([]byte) error

type LocalNodeInfoResponse

type LocalNodeInfoResponse struct {
	session.ResponseHeaders
	// contains filtered or unexported fields
}

func (*LocalNodeInfoResponse) FromGRPCMessage

func (l *LocalNodeInfoResponse) FromGRPCMessage(m neofsgrpc.Message) error

func (*LocalNodeInfoResponse) GetBody

func (*LocalNodeInfoResponse) SetBody

func (*LocalNodeInfoResponse) ToGRPCMessage

func (l *LocalNodeInfoResponse) ToGRPCMessage() neofsgrpc.Message

type LocalNodeInfoResponseBody

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

func (*LocalNodeInfoResponseBody) FromGRPCMessage

func (l *LocalNodeInfoResponseBody) FromGRPCMessage(m neofsgrpc.Message) error

func (*LocalNodeInfoResponseBody) GetNodeInfo

func (l *LocalNodeInfoResponseBody) GetNodeInfo() *NodeInfo

func (*LocalNodeInfoResponseBody) GetVersion

func (l *LocalNodeInfoResponseBody) GetVersion() *refs.Version

func (*LocalNodeInfoResponseBody) SetNodeInfo

func (l *LocalNodeInfoResponseBody) SetNodeInfo(nodeInfo *NodeInfo)

func (*LocalNodeInfoResponseBody) SetVersion

func (l *LocalNodeInfoResponseBody) SetVersion(version *refs.Version)

func (*LocalNodeInfoResponseBody) StableMarshal

func (l *LocalNodeInfoResponseBody) StableMarshal(buf []byte) ([]byte, error)

func (*LocalNodeInfoResponseBody) StableSize

func (l *LocalNodeInfoResponseBody) StableSize() (size int)

func (*LocalNodeInfoResponseBody) ToGRPCMessage

func (l *LocalNodeInfoResponseBody) ToGRPCMessage() neofsgrpc.Message

func (*LocalNodeInfoResponseBody) Unmarshal

func (l *LocalNodeInfoResponseBody) Unmarshal(data []byte) error

type NetworkInfo

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

NetworkInfo groups information about NeoFS network.

func (*NetworkInfo) FromGRPCMessage

func (i *NetworkInfo) FromGRPCMessage(m neofsgrpc.Message) error

func (*NetworkInfo) GetCurrentEpoch

func (i *NetworkInfo) GetCurrentEpoch() uint64

GetCurrentEpoch returns number of the current epoch.

func (*NetworkInfo) GetMagicNumber

func (i *NetworkInfo) GetMagicNumber() uint64

GetMagicNumber returns magic number of the sidechain.

func (*NetworkInfo) MarshalJSON

func (i *NetworkInfo) MarshalJSON() ([]byte, error)

func (*NetworkInfo) SetCurrentEpoch

func (i *NetworkInfo) SetCurrentEpoch(epoch uint64)

SetCurrentEpoch sets number of the current epoch.

func (*NetworkInfo) SetMagicNumber

func (i *NetworkInfo) SetMagicNumber(magic uint64)

SetMagicNumber sets magic number of the sidechain.

func (*NetworkInfo) StableMarshal

func (i *NetworkInfo) StableMarshal(buf []byte) ([]byte, error)

func (*NetworkInfo) StableSize

func (i *NetworkInfo) StableSize() (size int)

func (*NetworkInfo) ToGRPCMessage

func (i *NetworkInfo) ToGRPCMessage() neofsgrpc.Message

func (*NetworkInfo) Unmarshal

func (i *NetworkInfo) Unmarshal(data []byte) error

func (*NetworkInfo) UnmarshalJSON

func (i *NetworkInfo) UnmarshalJSON(data []byte) error

type NetworkInfoRequest

type NetworkInfoRequest struct {
	session.RequestHeaders
	// contains filtered or unexported fields
}

NetworkInfoRequest is a structure of NetworkInfo request.

func (*NetworkInfoRequest) FromGRPCMessage

func (l *NetworkInfoRequest) FromGRPCMessage(m neofsgrpc.Message) error

func (*NetworkInfoRequest) GetBody

func (*NetworkInfoRequest) SetBody

func (l *NetworkInfoRequest) SetBody(body *NetworkInfoRequestBody)

func (*NetworkInfoRequest) ToGRPCMessage

func (l *NetworkInfoRequest) ToGRPCMessage() neofsgrpc.Message

type NetworkInfoRequestBody

type NetworkInfoRequestBody struct{}

NetworkInfoRequestBody is a structure of NetworkInfo request body.

func (*NetworkInfoRequestBody) FromGRPCMessage

func (l *NetworkInfoRequestBody) FromGRPCMessage(m neofsgrpc.Message) error

func (*NetworkInfoRequestBody) StableMarshal

func (l *NetworkInfoRequestBody) StableMarshal(buf []byte) ([]byte, error)

func (*NetworkInfoRequestBody) StableSize

func (l *NetworkInfoRequestBody) StableSize() (size int)

func (*NetworkInfoRequestBody) ToGRPCMessage

func (l *NetworkInfoRequestBody) ToGRPCMessage() neofsgrpc.Message

func (*NetworkInfoRequestBody) Unmarshal

func (l *NetworkInfoRequestBody) Unmarshal(data []byte) error

type NetworkInfoResponse

type NetworkInfoResponse struct {
	session.ResponseHeaders
	// contains filtered or unexported fields
}

NetworkInfoResponse is a structure of NetworkInfo response.

func (*NetworkInfoResponse) FromGRPCMessage

func (l *NetworkInfoResponse) FromGRPCMessage(m neofsgrpc.Message) error

func (*NetworkInfoResponse) GetBody

func (*NetworkInfoResponse) SetBody

func (l *NetworkInfoResponse) SetBody(body *NetworkInfoResponseBody)

func (*NetworkInfoResponse) ToGRPCMessage

func (l *NetworkInfoResponse) ToGRPCMessage() neofsgrpc.Message

type NetworkInfoResponseBody

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

NetworkInfoResponseBody is a structure of NetworkInfo response body.

func (*NetworkInfoResponseBody) FromGRPCMessage

func (i *NetworkInfoResponseBody) FromGRPCMessage(m neofsgrpc.Message) error

func (*NetworkInfoResponseBody) GetNetworkInfo

func (i *NetworkInfoResponseBody) GetNetworkInfo() *NetworkInfo

GetNetworkInfo returns information about the NeoFS network.

func (*NetworkInfoResponseBody) SetNetworkInfo

func (i *NetworkInfoResponseBody) SetNetworkInfo(netInfo *NetworkInfo)

SetNetworkInfo sets information about the NeoFS network.

func (*NetworkInfoResponseBody) StableMarshal

func (i *NetworkInfoResponseBody) StableMarshal(buf []byte) ([]byte, error)

func (*NetworkInfoResponseBody) StableSize

func (i *NetworkInfoResponseBody) StableSize() (size int)

func (*NetworkInfoResponseBody) ToGRPCMessage

func (i *NetworkInfoResponseBody) ToGRPCMessage() neofsgrpc.Message

func (*NetworkInfoResponseBody) Unmarshal

func (i *NetworkInfoResponseBody) Unmarshal(data []byte) error

type NodeInfo

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

NodeInfo of storage node.

func (*NodeInfo) FromGRPCMessage

func (ni *NodeInfo) FromGRPCMessage(m neofsgrpc.Message) error

func (*NodeInfo) GetAddress deprecated

func (ni *NodeInfo) GetAddress() (addr string)

GetAddress returns node's network address.

Deprecated: use IterateAddresses.

func (*NodeInfo) GetAttributes

func (ni *NodeInfo) GetAttributes() []*Attribute

func (*NodeInfo) GetPublicKey

func (ni *NodeInfo) GetPublicKey() []byte

func (*NodeInfo) GetState

func (ni *NodeInfo) GetState() NodeState

func (*NodeInfo) IterateAddresses

func (ni *NodeInfo) IterateAddresses(f func(string) bool)

IterateAddresses iterates over network addresses of the node. Breaks iteration on f's true return.

Handler should not be nil.

func (*NodeInfo) MarshalJSON

func (ni *NodeInfo) MarshalJSON() ([]byte, error)

func (*NodeInfo) NumberOfAddresses

func (ni *NodeInfo) NumberOfAddresses() int

NumberOfAddresses returns number of network addresses of the node.

func (*NodeInfo) SetAddress deprecated

func (ni *NodeInfo) SetAddress(v string)

SetAddress sets node's network address.

Deprecated: use SetAddresses.

func (*NodeInfo) SetAddresses

func (ni *NodeInfo) SetAddresses(v ...string)

SetAddresses sets list of network addresses of the node.

func (*NodeInfo) SetAttributes

func (ni *NodeInfo) SetAttributes(v []*Attribute)

func (*NodeInfo) SetPublicKey

func (ni *NodeInfo) SetPublicKey(v []byte)

func (*NodeInfo) SetState

func (ni *NodeInfo) SetState(state NodeState)

func (*NodeInfo) StableMarshal

func (ni *NodeInfo) StableMarshal(buf []byte) ([]byte, error)

func (*NodeInfo) StableSize

func (ni *NodeInfo) StableSize() (size int)

func (*NodeInfo) ToGRPCMessage

func (ni *NodeInfo) ToGRPCMessage() neofsgrpc.Message

func (*NodeInfo) Unmarshal

func (ni *NodeInfo) Unmarshal(data []byte) error

func (*NodeInfo) UnmarshalJSON

func (ni *NodeInfo) UnmarshalJSON(data []byte) error

type NodeState

type NodeState uint32

NodeState of storage node.

const (
	UnspecifiedState NodeState = iota
	Online
	Offline
)

func NodeStateFromRPCMessage

func NodeStateFromRPCMessage(n netmap.NodeInfo_State) NodeState

func (*NodeState) FromString

func (x *NodeState) FromString(s string) bool

FromString parses NodeState from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (NodeState) String

func (x NodeState) String() string

String returns string representation of NodeState.

type Operation

type Operation uint32
const (
	UnspecifiedOperation Operation = iota
	EQ
	NE
	GT
	GE
	LT
	LE
	OR
	AND
)

func OperationFromGRPCMessage

func OperationFromGRPCMessage(n netmap.Operation) Operation

func (*Operation) FromString

func (x *Operation) FromString(s string) bool

FromString parses Operation from a string representation. It is a reverse action to String().

Returns true if s was parsed successfully.

func (Operation) String

func (x Operation) String() string

String returns string representation of Operation.

type PlacementPolicy

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

func (*PlacementPolicy) FromGRPCMessage

func (p *PlacementPolicy) FromGRPCMessage(m neofsgrpc.Message) error

func (*PlacementPolicy) GetContainerBackupFactor

func (p *PlacementPolicy) GetContainerBackupFactor() uint32

func (*PlacementPolicy) GetFilters

func (p *PlacementPolicy) GetFilters() []*Filter

func (*PlacementPolicy) GetReplicas

func (p *PlacementPolicy) GetReplicas() []*Replica

func (*PlacementPolicy) GetSelectors

func (p *PlacementPolicy) GetSelectors() []*Selector

func (*PlacementPolicy) MarshalJSON

func (p *PlacementPolicy) MarshalJSON() ([]byte, error)

func (*PlacementPolicy) SetContainerBackupFactor

func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32)

func (*PlacementPolicy) SetFilters

func (p *PlacementPolicy) SetFilters(filters []*Filter)

func (*PlacementPolicy) SetReplicas

func (p *PlacementPolicy) SetReplicas(replicas []*Replica)

func (*PlacementPolicy) SetSelectors

func (p *PlacementPolicy) SetSelectors(selectors []*Selector)

func (*PlacementPolicy) StableMarshal

func (p *PlacementPolicy) StableMarshal(buf []byte) ([]byte, error)

func (*PlacementPolicy) StableSize

func (p *PlacementPolicy) StableSize() (size int)

func (*PlacementPolicy) ToGRPCMessage

func (p *PlacementPolicy) ToGRPCMessage() neofsgrpc.Message

func (*PlacementPolicy) Unmarshal

func (p *PlacementPolicy) Unmarshal(data []byte) error

func (*PlacementPolicy) UnmarshalJSON

func (p *PlacementPolicy) UnmarshalJSON(data []byte) error

type Replica

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

func ReplicasFromGRPC

func ReplicasFromGRPC(rs []*netmap.Replica) (res []*Replica, err error)

func (*Replica) FromGRPCMessage

func (r *Replica) FromGRPCMessage(m neofsgrpc.Message) error

func (*Replica) GetCount

func (r *Replica) GetCount() uint32

func (*Replica) GetSelector

func (r *Replica) GetSelector() string

func (*Replica) MarshalJSON

func (r *Replica) MarshalJSON() ([]byte, error)

func (*Replica) SetCount

func (r *Replica) SetCount(count uint32)

func (*Replica) SetSelector

func (r *Replica) SetSelector(selector string)

func (*Replica) StableMarshal

func (r *Replica) StableMarshal(buf []byte) ([]byte, error)

func (*Replica) StableSize

func (r *Replica) StableSize() (size int)

func (*Replica) ToGRPCMessage

func (r *Replica) ToGRPCMessage() neofsgrpc.Message

func (*Replica) Unmarshal

func (r *Replica) Unmarshal(data []byte) error

func (*Replica) UnmarshalJSON

func (r *Replica) UnmarshalJSON(data []byte) error

type Selector

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

func SelectorsFromGRPC

func SelectorsFromGRPC(ss []*netmap.Selector) (res []*Selector, err error)

func (*Selector) FromGRPCMessage

func (s *Selector) FromGRPCMessage(m neofsgrpc.Message) error

func (*Selector) GetAttribute

func (s *Selector) GetAttribute() string

func (*Selector) GetClause

func (s *Selector) GetClause() Clause

func (*Selector) GetCount

func (s *Selector) GetCount() uint32

func (*Selector) GetFilter

func (s *Selector) GetFilter() string

func (*Selector) GetName

func (s *Selector) GetName() string

func (*Selector) MarshalJSON

func (s *Selector) MarshalJSON() ([]byte, error)

func (*Selector) SetAttribute

func (s *Selector) SetAttribute(attribute string)

func (*Selector) SetClause

func (s *Selector) SetClause(clause Clause)

func (*Selector) SetCount

func (s *Selector) SetCount(count uint32)

func (*Selector) SetFilter

func (s *Selector) SetFilter(filter string)

func (*Selector) SetName

func (s *Selector) SetName(name string)

func (*Selector) StableMarshal

func (s *Selector) StableMarshal(buf []byte) ([]byte, error)

func (*Selector) StableSize

func (s *Selector) StableSize() (size int)

func (*Selector) ToGRPCMessage

func (s *Selector) ToGRPCMessage() neofsgrpc.Message

func (*Selector) Unmarshal

func (s *Selector) Unmarshal(data []byte) error

func (*Selector) UnmarshalJSON

func (s *Selector) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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