bootstrap

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthService        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowService          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterBootstrapServer

func RegisterBootstrapServer(s *grpc.Server, srv BootstrapServer)

Types

type BootstrapClient

type BootstrapClient interface {
	// Process is method that allows to register node in the network and receive actual netmap
	Process(ctx context.Context, in *Request, opts ...grpc.CallOption) (*SpreadMap, error)
}

BootstrapClient is the client API for Bootstrap service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewBootstrapClient

func NewBootstrapClient(cc *grpc.ClientConn) BootstrapClient

type BootstrapServer

type BootstrapServer interface {
	// Process is method that allows to register node in the network and receive actual netmap
	Process(context.Context, *Request) (*SpreadMap, error)
}

BootstrapServer is the server API for Bootstrap service.

type NodeInfo

type NodeInfo struct {
	// Address is a node [multi-address](https://github.com/multiformats/multiaddr)
	Address string `protobuf:"bytes,1,opt,name=Address,proto3" json:"address"`
	// PubKey is a compressed public key representation in bytes
	PubKey []byte `protobuf:"bytes,2,opt,name=PubKey,proto3" json:"pubkey,omitempty"`
	// Options is set of node optional information, such as storage capacity, node location, price and etc
	Options []string `protobuf:"bytes,3,rep,name=Options,proto3" json:"options,omitempty"`
	// Status is bitmap status of the node
	Status               NodeStatus `protobuf:"varint,4,opt,name=Status,proto3,customtype=NodeStatus" json:"status"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (NodeInfo) Capacity

func (m NodeInfo) Capacity() uint64

Capacity returns node's capacity as reported by user.

func (*NodeInfo) Descriptor

func (*NodeInfo) Descriptor() ([]byte, []int)

func (NodeInfo) Equals

func (m NodeInfo) Equals(n1 NodeInfo) bool

Equals checks whether two NodeInfo has same address.

func (*NodeInfo) GetAddress

func (m *NodeInfo) GetAddress() string

func (*NodeInfo) GetOptions

func (m *NodeInfo) GetOptions() []string

func (*NodeInfo) GetPubKey

func (m *NodeInfo) GetPubKey() []byte

func (*NodeInfo) Marshal

func (m *NodeInfo) Marshal() (dAtA []byte, err error)

func (*NodeInfo) MarshalTo

func (m *NodeInfo) MarshalTo(dAtA []byte) (int, error)

func (*NodeInfo) MarshalToSizedBuffer

func (m *NodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (NodeInfo) Price

func (m NodeInfo) Price() uint64

Price returns price in 1e-8*GAS/Megabyte per month. User set price in GAS/Terabyte per month.

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) Reset

func (m *NodeInfo) Reset()

func (*NodeInfo) Size

func (m *NodeInfo) Size() (n int)

func (NodeInfo) String

func (m NodeInfo) String() string

String returns string representation of NodeInfo.

func (*NodeInfo) Unmarshal

func (m *NodeInfo) Unmarshal(dAtA []byte) error

func (*NodeInfo) XXX_DiscardUnknown

func (m *NodeInfo) XXX_DiscardUnknown()

func (*NodeInfo) XXX_Marshal

func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodeInfo) XXX_Merge

func (m *NodeInfo) XXX_Merge(src proto.Message)

func (*NodeInfo) XXX_Size

func (m *NodeInfo) XXX_Size() int

func (*NodeInfo) XXX_Unmarshal

func (m *NodeInfo) XXX_Unmarshal(b []byte) error

type NodeStatus

type NodeStatus uint64

NodeStatus is a bitwise status field of the node.

func (NodeStatus) Full

func (n NodeStatus) Full() bool

Full checks if node has enough space for storing users objects.

func (*NodeStatus) SetFull

func (n *NodeStatus) SetFull(value bool)

SetFull changes state of node to indicate if node has enough space for storing users objects. If value is true - there's not enough space.

type NodeType

type NodeType = service.NodeRole

NodeType type alias.

type Request

type Request struct {
	// Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2)
	Type NodeType `protobuf:"varint,1,opt,name=type,proto3,customtype=NodeType" json:"type"`
	// Info contains information about node
	Info NodeInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info"`
	// RequestMetaHeader contains information about request meta headers (should be embedded into message)
	service.RequestMetaHeader `protobuf:"bytes,98,opt,name=Meta,proto3,embedded=Meta" json:"Meta"`
	// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
	service.RequestVerificationHeader `protobuf:"bytes,99,opt,name=Verify,proto3,embedded=Verify" json:"Verify"`
	XXX_NoUnkeyedLiteral              struct{} `json:"-"`
	XXX_unrecognized                  []byte   `json:"-"`
	XXX_sizecache                     int32    `json:"-"`
}

func (*Request) Descriptor

func (*Request) Descriptor() ([]byte, []int)

func (*Request) GetInfo

func (m *Request) GetInfo() NodeInfo

func (*Request) Marshal

func (m *Request) Marshal() (dAtA []byte, err error)

func (*Request) MarshalTo

func (m *Request) MarshalTo(dAtA []byte) (int, error)

func (*Request) MarshalToSizedBuffer

func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) Size

func (m *Request) Size() (n int)

func (*Request) String

func (m *Request) String() string

func (*Request) Unmarshal

func (m *Request) Unmarshal(dAtA []byte) error

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Request) XXX_Merge

func (m *Request) XXX_Merge(src proto.Message)

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

func (m *Request) XXX_Unmarshal(b []byte) error

type SpreadMap

type SpreadMap struct {
	// Epoch is current epoch for netmap
	Epoch uint64 `protobuf:"varint,1,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
	// NetMap is a set of NodeInfos
	NetMap               []NodeInfo `protobuf:"bytes,2,rep,name=NetMap,proto3" json:"NetMap"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*SpreadMap) Descriptor

func (*SpreadMap) Descriptor() ([]byte, []int)

func (*SpreadMap) GetEpoch

func (m *SpreadMap) GetEpoch() uint64

func (*SpreadMap) GetNetMap

func (m *SpreadMap) GetNetMap() []NodeInfo

func (*SpreadMap) Marshal

func (m *SpreadMap) Marshal() (dAtA []byte, err error)

func (*SpreadMap) MarshalTo

func (m *SpreadMap) MarshalTo(dAtA []byte) (int, error)

func (*SpreadMap) MarshalToSizedBuffer

func (m *SpreadMap) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SpreadMap) ProtoMessage

func (*SpreadMap) ProtoMessage()

func (*SpreadMap) Reset

func (m *SpreadMap) Reset()

func (*SpreadMap) Size

func (m *SpreadMap) Size() (n int)

func (SpreadMap) String

func (m SpreadMap) String() string

String returns string representation of SpreadMap.

func (*SpreadMap) Unmarshal

func (m *SpreadMap) Unmarshal(dAtA []byte) error

func (*SpreadMap) XXX_DiscardUnknown

func (m *SpreadMap) XXX_DiscardUnknown()

func (*SpreadMap) XXX_Marshal

func (m *SpreadMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SpreadMap) XXX_Merge

func (m *SpreadMap) XXX_Merge(src proto.Message)

func (*SpreadMap) XXX_Size

func (m *SpreadMap) XXX_Size() int

func (*SpreadMap) XXX_Unmarshal

func (m *SpreadMap) XXX_Unmarshal(b []byte) error

type UnimplementedBootstrapServer

type UnimplementedBootstrapServer struct {
}

UnimplementedBootstrapServer can be embedded to have forward compatible implementations.

func (*UnimplementedBootstrapServer) Process

Jump to

Keyboard shortcuts

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