Documentation ¶
Overview ¶
Package service defines the generic interface for node services.
Index ¶
- Variables
- type CONNECTION
- type Handler
- type Hello
- func (*Hello) Descriptor() ([]byte, []int)
- func (m *Hello) GetAgent() string
- func (m *Hello) GetPayload() []byte
- func (m *Hello) GetSignature() []byte
- func (m *Hello) GetType() CONNECTION
- func (*Hello) ProtoMessage()
- func (m *Hello) Reset()
- func (m *Hello) String() string
- func (m *Hello) XXX_DiscardUnknown()
- func (m *Hello) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Hello) XXX_Merge(src proto.Message)
- func (m *Hello) XXX_Size() int
- func (m *Hello) XXX_Unmarshal(b []byte) error
- type HelloInfo
- func (*HelloInfo) Descriptor() ([]byte, []int)
- func (m *HelloInfo) GetClient() uint64
- func (m *HelloInfo) GetNonce() []byte
- func (m *HelloInfo) GetServer() uint64
- func (m *HelloInfo) GetTimestamp() time.Time
- func (*HelloInfo) ProtoMessage()
- func (m *HelloInfo) Reset()
- func (m *HelloInfo) String() string
- func (m *HelloInfo) XXX_DiscardUnknown()
- func (m *HelloInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *HelloInfo) XXX_Merge(src proto.Message)
- func (m *HelloInfo) XXX_Size() int
- func (m *HelloInfo) XXX_Unmarshal(b []byte) error
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetError() string
- func (m *Message) GetID() uint64
- func (m *Message) GetOpcode() int32
- func (m *Message) GetPayload() []byte
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var CONNECTION_name = map[int32]string{
0: "UNKNOWN",
1: "BROADCAST",
2: "SBAC",
3: "KV",
4: "CHECKER",
}
View Source
var CONNECTION_value = map[string]int32{
"UNKNOWN": 0,
"BROADCAST": 1,
"SBAC": 2,
"KV": 3,
"CHECKER": 4,
}
Functions ¶
This section is empty.
Types ¶
type CONNECTION ¶
type CONNECTION int32
const ( CONNECTION_UNKNOWN CONNECTION = 0 CONNECTION_BROADCAST CONNECTION = 1 CONNECTION_SBAC CONNECTION = 2 CONNECTION_KV CONNECTION = 3 CONNECTION_CHECKER CONNECTION = 4 )
func (CONNECTION) EnumDescriptor ¶
func (CONNECTION) EnumDescriptor() ([]byte, []int)
func (CONNECTION) String ¶
func (x CONNECTION) String() string
type Hello ¶
type Hello struct { Agent string `protobuf:"bytes,1,opt,name=agent,proto3" json:"agent,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` Type CONNECTION `protobuf:"varint,4,opt,name=type,proto3,enum=service.CONNECTION" json:"type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func SignHello ¶
func SignHello(clientID uint64, serverID uint64, key signature.KeyPair, c CONNECTION) (*Hello, error)
SignHello returns a signed payload for use as a Hello in a service connection.
func (*Hello) Descriptor ¶
func (*Hello) GetPayload ¶
func (*Hello) GetSignature ¶
func (*Hello) GetType ¶
func (m *Hello) GetType() CONNECTION
func (*Hello) ProtoMessage ¶
func (*Hello) ProtoMessage()
func (*Hello) XXX_DiscardUnknown ¶
func (m *Hello) XXX_DiscardUnknown()
func (*Hello) XXX_Marshal ¶
func (*Hello) XXX_Unmarshal ¶
type HelloInfo ¶
type HelloInfo struct { Client uint64 `protobuf:"varint,1,opt,name=client,proto3" json:"client,omitempty"` Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` Server uint64 `protobuf:"varint,3,opt,name=server,proto3" json:"server,omitempty"` Timestamp time.Time `protobuf:"bytes,4,opt,name=timestamp,stdtime" json:"timestamp"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HelloInfo) Descriptor ¶
func (*HelloInfo) GetTimestamp ¶
func (*HelloInfo) ProtoMessage ¶
func (*HelloInfo) ProtoMessage()
func (*HelloInfo) XXX_DiscardUnknown ¶
func (m *HelloInfo) XXX_DiscardUnknown()
func (*HelloInfo) XXX_Marshal ¶
func (*HelloInfo) XXX_Unmarshal ¶
type Message ¶
type Message struct { ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Opcode int32 `protobuf:"varint,3,opt,name=opcode,proto3" json:"opcode,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func EncodeMessage ¶
EncodeMessage takes a protobuf-compatible struct and encodes it into a service Message.
func (*Message) Descriptor ¶
func (*Message) GetPayload ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.