bootstrap

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 17 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")
)
View Source
var Request_State_name = map[int32]string{
	0: "Unknown",
	1: "Online",
	2: "Offline",
}
View Source
var Request_State_value = map[string]int32{
	"Unknown": 0,
	"Online":  1,
	"Offline": 2,
}

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"`
	// State contains node status
	State Request_State `protobuf:"varint,3,opt,name=state,proto3,enum=bootstrap.Request_State" json:"state,omitempty"`
	// 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) GetState added in v0.6.2

func (m *Request) GetState() Request_State

func (Request) GetType added in v0.7.4

func (m Request) GetType() NodeType

GetType is a Type field getter.

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) ReadSignedData added in v0.7.4

func (m Request) ReadSignedData(p []byte) (int, error)

ReadSignedData copies payload bytes to passed buffer.

If the Request size is insufficient, io.ErrUnexpectedEOF returns.

func (*Request) Reset

func (m *Request) Reset()

func (*Request) SetInfo added in v0.7.4

func (m *Request) SetInfo(info NodeInfo)

SetInfo is an Info field getter.

func (*Request) SetState added in v0.7.4

func (m *Request) SetState(state Request_State)

SetState is a State field setter.

func (*Request) SetType added in v0.7.4

func (m *Request) SetType(t NodeType)

SetType is a Type field setter.

func (Request) SignedData added in v0.7.4

func (m Request) SignedData() ([]byte, error)

SignedData returns payload bytes of the request.

func (Request) SignedDataSize added in v0.7.4

func (m Request) SignedDataSize() (sz int)

SignedDataSize returns payload size of the request.

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 Request_State added in v0.6.2

type Request_State int32

Node state

const (
	// used by default
	Request_Unknown Request_State = 0
	// used to inform that node online
	Request_Online Request_State = 1
	// used to inform that node offline
	Request_Offline Request_State = 2
)

func (Request_State) Bytes added in v0.7.4

func (x Request_State) Bytes() []byte

Bytes returns a binary representation of the state.

func (Request_State) EnumDescriptor added in v0.6.2

func (Request_State) EnumDescriptor() ([]byte, []int)

func (Request_State) Size added in v0.7.4

func (x Request_State) Size() int

Size returns the size necessary for a binary representation of the state.

func (Request_State) String added in v0.6.2

func (x Request_State) String() string

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