netmap

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 10 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeToGRPCMessage

func AttributeToGRPCMessage(a *Attribute) *netmap.NodeInfo_Attribute

func ClauseToGRPCMessage

func ClauseToGRPCMessage(n Clause) netmap.Clause

func FilterToGRPCMessage

func FilterToGRPCMessage(f *Filter) *netmap.Filter

func LocalNodeInfoRequestToGRPCMessage

func LocalNodeInfoRequestToGRPCMessage(r *LocalNodeInfoRequest) *netmap.LocalNodeInfoRequest

func LocalNodeInfoResponseToGRPCMessage

func LocalNodeInfoResponseToGRPCMessage(r *LocalNodeInfoResponse) *netmap.LocalNodeInfoResponse

func NetworkInfoRequestBodyToGRPCMessage added in v1.24.0

func NetworkInfoRequestBodyToGRPCMessage(r *NetworkInfoRequestBody) *netmap.NetworkInfoRequest_Body

func NetworkInfoRequestToGRPCMessage added in v1.24.0

func NetworkInfoRequestToGRPCMessage(r *NetworkInfoRequest) *netmap.NetworkInfoRequest

func NetworkInfoResponseBodyToGRPCMessage added in v1.24.0

func NetworkInfoResponseBodyToGRPCMessage(r *NetworkInfoResponseBody) *netmap.NetworkInfoResponse_Body

func NetworkInfoResponseToGRPCMessage added in v1.24.0

func NetworkInfoResponseToGRPCMessage(r *NetworkInfoResponse) *netmap.NetworkInfoResponse

func NetworkInfoToGRPCMessage added in v1.24.0

func NetworkInfoToGRPCMessage(n *NetworkInfo) *netmap.NetworkInfo

func NodeInfoToGRPCMessage

func NodeInfoToGRPCMessage(n *NodeInfo) *netmap.NodeInfo

func NodeStateToGRPCMessage

func NodeStateToGRPCMessage(n NodeState) netmap.NodeInfo_State

func OperationToGRPCMessage

func OperationToGRPCMessage(n Operation) netmap.Operation

func PlacementPolicyToGRPCMessage

func PlacementPolicyToGRPCMessage(p *PlacementPolicy) *netmap.PlacementPolicy

func ReplicaToGRPCMessage

func ReplicaToGRPCMessage(r *Replica) *netmap.Replica

func SelectorToGRPCMessage

func SelectorToGRPCMessage(s *Selector) *netmap.Selector

Types

type Attribute

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

Attribute of storage node.

func AttributeFromGRPCMessage

func AttributeFromGRPCMessage(m *netmap.NodeInfo_Attribute) *Attribute

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) 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

type Client

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

Client represents universal netmap transport client.

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient is a constructor for netmap transport client.

func (*Client) LocalNodeInfo

func (c *Client) LocalNodeInfo(ctx context.Context, req *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error)

LocalNodeInfo sends LocalNodeInfoRequest over the network.

func (*Client) NetworkInfo added in v1.24.0

func (c *Client) NetworkInfo(ctx context.Context, req *NetworkInfoRequest) (*NetworkInfoResponse, error)

NetworkInfo sends NetworkInfoRequest over the network.

type Filter

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

func FilterFromGRPCMessage

func FilterFromGRPCMessage(m *netmap.Filter) *Filter

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) Unmarshal

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

func (*Filter) UnmarshalJSON

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

type LocalNodeInfoRequest

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

func LocalNodeInfoRequestFromGRPCMessage

func LocalNodeInfoRequestFromGRPCMessage(m *netmap.LocalNodeInfoRequest) *LocalNodeInfoRequest

func (*LocalNodeInfoRequest) GetBody

func (*LocalNodeInfoRequest) GetMetaHeader

func (l *LocalNodeInfoRequest) GetMetaHeader() *session.RequestMetaHeader

func (*LocalNodeInfoRequest) GetVerificationHeader

func (l *LocalNodeInfoRequest) GetVerificationHeader() *session.RequestVerificationHeader

func (*LocalNodeInfoRequest) SetBody

func (*LocalNodeInfoRequest) SetMetaHeader

func (l *LocalNodeInfoRequest) SetMetaHeader(metaHeader *session.RequestMetaHeader)

func (*LocalNodeInfoRequest) SetVerificationHeader

func (l *LocalNodeInfoRequest) SetVerificationHeader(verifyHeader *session.RequestVerificationHeader)

type LocalNodeInfoRequestBody

type LocalNodeInfoRequestBody struct{}

func (*LocalNodeInfoRequestBody) StableMarshal

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

func (*LocalNodeInfoRequestBody) StableSize

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

type LocalNodeInfoResponse

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

func LocalNodeInfoResponseFromGRPCMessage

func LocalNodeInfoResponseFromGRPCMessage(m *netmap.LocalNodeInfoResponse) *LocalNodeInfoResponse

func (*LocalNodeInfoResponse) GetBody

func (*LocalNodeInfoResponse) GetMetaHeader

func (l *LocalNodeInfoResponse) GetMetaHeader() *session.ResponseMetaHeader

func (*LocalNodeInfoResponse) GetVerificationHeader

func (l *LocalNodeInfoResponse) GetVerificationHeader() *session.ResponseVerificationHeader

func (*LocalNodeInfoResponse) SetBody

func (*LocalNodeInfoResponse) SetMetaHeader

func (l *LocalNodeInfoResponse) SetMetaHeader(metaHeader *session.ResponseMetaHeader)

func (*LocalNodeInfoResponse) SetVerificationHeader

func (l *LocalNodeInfoResponse) SetVerificationHeader(verifyHeader *session.ResponseVerificationHeader)

type LocalNodeInfoResponseBody

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

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)

type NetworkInfo added in v1.24.0

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

NetworkInfo groups information about NeoFS network.

func NetworkInfoFromGRPCMessage added in v1.24.0

func NetworkInfoFromGRPCMessage(m *netmap.NetworkInfo) *NetworkInfo

func (*NetworkInfo) GetCurrentEpoch added in v1.24.0

func (i *NetworkInfo) GetCurrentEpoch() uint64

GetCurrentEpoch returns number of the current epoch.

func (*NetworkInfo) GetMagicNumber added in v1.24.0

func (i *NetworkInfo) GetMagicNumber() uint64

GetMagicNumber returns magic number of the sidechain.

func (*NetworkInfo) MarshalJSON added in v1.24.0

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

func (*NetworkInfo) SetCurrentEpoch added in v1.24.0

func (i *NetworkInfo) SetCurrentEpoch(epoch uint64)

SetCurrentEpoch sets number of the current epoch.

func (*NetworkInfo) SetMagicNumber added in v1.24.0

func (i *NetworkInfo) SetMagicNumber(magic uint64)

SetMagicNumber sets magic number of the sidechain.

func (*NetworkInfo) StableMarshal added in v1.24.0

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

func (*NetworkInfo) StableSize added in v1.24.0

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

func (*NetworkInfo) Unmarshal added in v1.24.0

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

func (*NetworkInfo) UnmarshalJSON added in v1.24.0

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

type NetworkInfoRequest added in v1.24.0

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

NetworkInfoRequest is a structure of NetworkInfo request.

func NetworkInfoRequestFromGRPCMessage added in v1.24.0

func NetworkInfoRequestFromGRPCMessage(m *netmap.NetworkInfoRequest) *NetworkInfoRequest

func (*NetworkInfoRequest) GetBody added in v1.24.0

func (*NetworkInfoRequest) GetMetaHeader added in v1.24.0

func (l *NetworkInfoRequest) GetMetaHeader() *session.RequestMetaHeader

func (*NetworkInfoRequest) GetVerificationHeader added in v1.24.0

func (l *NetworkInfoRequest) GetVerificationHeader() *session.RequestVerificationHeader

func (*NetworkInfoRequest) SetBody added in v1.24.0

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

func (*NetworkInfoRequest) SetMetaHeader added in v1.24.0

func (l *NetworkInfoRequest) SetMetaHeader(metaHeader *session.RequestMetaHeader)

func (*NetworkInfoRequest) SetVerificationHeader added in v1.24.0

func (l *NetworkInfoRequest) SetVerificationHeader(verifyHeader *session.RequestVerificationHeader)

type NetworkInfoRequestBody added in v1.24.0

type NetworkInfoRequestBody struct{}

NetworkInfoRequestBody is a structure of NetworkInfo request body.

func NetworkInfoRequestBodyFromGRPCMessage added in v1.24.0

func NetworkInfoRequestBodyFromGRPCMessage(m *netmap.NetworkInfoRequest_Body) *NetworkInfoRequestBody

func (*NetworkInfoRequestBody) StableMarshal added in v1.24.0

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

func (*NetworkInfoRequestBody) StableSize added in v1.24.0

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

type NetworkInfoResponse added in v1.24.0

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

NetworkInfoResponse is a structure of NetworkInfo response.

func NetworkInfoResponseFromGRPCMessage added in v1.24.0

func NetworkInfoResponseFromGRPCMessage(m *netmap.NetworkInfoResponse) *NetworkInfoResponse

func (*NetworkInfoResponse) GetBody added in v1.24.0

func (*NetworkInfoResponse) GetMetaHeader added in v1.24.0

func (l *NetworkInfoResponse) GetMetaHeader() *session.ResponseMetaHeader

func (*NetworkInfoResponse) GetVerificationHeader added in v1.24.0

func (l *NetworkInfoResponse) GetVerificationHeader() *session.ResponseVerificationHeader

func (*NetworkInfoResponse) SetBody added in v1.24.0

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

func (*NetworkInfoResponse) SetMetaHeader added in v1.24.0

func (l *NetworkInfoResponse) SetMetaHeader(metaHeader *session.ResponseMetaHeader)

func (*NetworkInfoResponse) SetVerificationHeader added in v1.24.0

func (l *NetworkInfoResponse) SetVerificationHeader(verifyHeader *session.ResponseVerificationHeader)

type NetworkInfoResponseBody added in v1.24.0

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

NetworkInfoResponseBody is a structure of NetworkInfo response body.

func NetworkInfoResponseBodyFromGRPCMessage added in v1.24.0

func NetworkInfoResponseBodyFromGRPCMessage(m *netmap.NetworkInfoResponse_Body) *NetworkInfoResponseBody

func (*NetworkInfoResponseBody) GetNetworkInfo added in v1.24.0

func (i *NetworkInfoResponseBody) GetNetworkInfo() *NetworkInfo

GetNetworkInfo returns information about the NeoFS network.

func (*NetworkInfoResponseBody) SetNetworkInfo added in v1.24.0

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

SetNetworkInfo sets information about the NeoFS network.

func (*NetworkInfoResponseBody) StableMarshal added in v1.24.0

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

func (*NetworkInfoResponseBody) StableSize added in v1.24.0

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

type NodeInfo

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

NodeInfo of storage node.

func NodeInfoFromGRPCMessage

func NodeInfoFromGRPCMessage(m *netmap.NodeInfo) *NodeInfo

func (*NodeInfo) GetAddress

func (ni *NodeInfo) GetAddress() string

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) MarshalJSON

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

func (*NodeInfo) SetAddress

func (ni *NodeInfo) SetAddress(v string)

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) 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

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

type Option

type Option func(*cfg)

Option represents Client option.

func WithGRPCCallOpts

func WithGRPCCallOpts(v []grpc.CallOption) Option

WithGRPCServiceClient sets GRPC specific call options.

func WithGRPCClient

func WithGRPCClient(v *netmap.Client) Option

WithGRPCServiceClient sets existing GRPC client.

func WithGRPCClientOpts

func WithGRPCClientOpts(v []netmap.Option) Option

WithGRPCServiceClient sets GRPC specific client options.

func WithGRPCServiceClient

func WithGRPCServiceClient(v netmap.NetmapServiceClient) Option

WithGRPCServiceClient sets existing service client.

func WithGlobalOpts

func WithGlobalOpts(v ...client.Option) Option

WithGlobalOpts sets global client options to client.

type PlacementPolicy

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

func PlacementPolicyFromGRPCMessage

func PlacementPolicyFromGRPCMessage(m *netmap.PlacementPolicy) *PlacementPolicy

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) 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 ReplicaFromGRPCMessage

func ReplicaFromGRPCMessage(m *netmap.Replica) *Replica

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) 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 SelectorFromGRPCMessage

func SelectorFromGRPCMessage(m *netmap.Selector) *Selector

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) Unmarshal

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

func (*Selector) UnmarshalJSON

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

type Service

type Service interface {
	LocalNodeInfo(ctx context.Context, request *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error)
	NetworkInfo(ctx context.Context, request *NetworkInfoRequest) (*NetworkInfoResponse, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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