netmap

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 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 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.

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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