Documentation
¶
Index ¶
- Variables
- func RegisterBootstrapServer(s *grpc.Server, srv BootstrapServer)
- type BootstrapClient
- type BootstrapServer
- type NodeInfo
- func (m NodeInfo) Capacity() uint64
- func (*NodeInfo) Descriptor() ([]byte, []int)
- func (m NodeInfo) Equals(n1 NodeInfo) bool
- func (m *NodeInfo) GetAddress() string
- func (m *NodeInfo) GetOptions() []string
- func (m *NodeInfo) GetPubKey() []byte
- func (m *NodeInfo) Marshal() (dAtA []byte, err error)
- func (m *NodeInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *NodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m NodeInfo) Price() uint64
- func (*NodeInfo) ProtoMessage()
- func (m *NodeInfo) Reset()
- func (m *NodeInfo) Size() (n int)
- func (m NodeInfo) String() string
- func (m *NodeInfo) Unmarshal(dAtA []byte) error
- func (m *NodeInfo) XXX_DiscardUnknown()
- func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NodeInfo) XXX_Merge(src proto.Message)
- func (m *NodeInfo) XXX_Size() int
- func (m *NodeInfo) XXX_Unmarshal(b []byte) error
- type NodeStatus
- type NodeType
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetInfo() NodeInfo
- func (m *Request) GetState() Request_State
- func (m Request) GetType() NodeType
- func (m *Request) Marshal() (dAtA []byte, err error)
- func (m *Request) MarshalTo(dAtA []byte) (int, error)
- func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Request) ProtoMessage()
- func (m Request) ReadSignedData(p []byte) (int, error)
- func (m *Request) Reset()
- func (m *Request) SetInfo(info NodeInfo)
- func (m *Request) SetState(state Request_State)
- func (m *Request) SetType(t NodeType)
- func (m Request) SignedData() ([]byte, error)
- func (m Request) SignedDataSize() (sz int)
- func (m *Request) Size() (n int)
- func (m *Request) String() string
- func (m *Request) Unmarshal(dAtA []byte) error
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Request_State
- type SpreadMap
- func (*SpreadMap) Descriptor() ([]byte, []int)
- func (m *SpreadMap) GetEpoch() uint64
- func (m *SpreadMap) GetNetMap() []NodeInfo
- func (m *SpreadMap) Marshal() (dAtA []byte, err error)
- func (m *SpreadMap) MarshalTo(dAtA []byte) (int, error)
- func (m *SpreadMap) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SpreadMap) ProtoMessage()
- func (m *SpreadMap) Reset()
- func (m *SpreadMap) Size() (n int)
- func (m SpreadMap) String() string
- func (m *SpreadMap) Unmarshal(dAtA []byte) error
- func (m *SpreadMap) XXX_DiscardUnknown()
- func (m *SpreadMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SpreadMap) XXX_Merge(src proto.Message)
- func (m *SpreadMap) XXX_Size() int
- func (m *SpreadMap) XXX_Unmarshal(b []byte) error
- type UnimplementedBootstrapServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowService = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var Request_State_name = map[int32]string{
0: "Unknown",
1: "Online",
2: "Offline",
}
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) Descriptor ¶
func (*NodeInfo) GetAddress ¶
func (*NodeInfo) GetOptions ¶
func (*NodeInfo) MarshalToSizedBuffer ¶
func (NodeInfo) Price ¶
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) XXX_DiscardUnknown ¶
func (m *NodeInfo) XXX_DiscardUnknown()
func (*NodeInfo) XXX_Marshal ¶
func (*NodeInfo) XXX_Unmarshal ¶
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 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) GetState ¶ added in v0.6.2
func (m *Request) GetState() Request_State
func (*Request) MarshalToSizedBuffer ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (Request) ReadSignedData ¶ added in v0.7.4
ReadSignedData copies payload bytes to passed buffer.
If the Request size is insufficient, io.ErrUnexpectedEOF returns.
func (*Request) SetState ¶ added in v0.7.4
func (m *Request) SetState(state Request_State)
SetState is a State field setter.
func (Request) SignedData ¶ added in v0.7.4
SignedData returns payload bytes of the request.
func (Request) SignedDataSize ¶ added in v0.7.4
SignedDataSize returns payload size of the request.
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
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) MarshalToSizedBuffer ¶
func (*SpreadMap) ProtoMessage ¶
func (*SpreadMap) ProtoMessage()
func (*SpreadMap) XXX_DiscardUnknown ¶
func (m *SpreadMap) XXX_DiscardUnknown()
func (*SpreadMap) XXX_Marshal ¶
func (*SpreadMap) XXX_Unmarshal ¶
type UnimplementedBootstrapServer ¶
type UnimplementedBootstrapServer struct {
}
UnimplementedBootstrapServer can be embedded to have forward compatible implementations.