Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructorOf(x interface{}) int64
- func ErrorMessage(out *MessageEnvelope, reqID uint64, errCode, errItem string)
- func SetLogLevel(l int)
- type ClusterMessage
- func (x *ClusterMessage) DeepCopy(z *ClusterMessage)
- func (*ClusterMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ClusterMessage) Fill(senderID []byte, e *MessageEnvelope, kvs ...*KeyValue)
- func (x *ClusterMessage) GetEnvelope() *MessageEnvelope
- func (x *ClusterMessage) GetSender() []byte
- func (x *ClusterMessage) GetStore() []*KeyValue
- func (x *ClusterMessage) Marshal() ([]byte, error)
- func (*ClusterMessage) ProtoMessage()
- func (x *ClusterMessage) ProtoReflect() protoreflect.Message
- func (x *ClusterMessage) Reset()
- func (x *ClusterMessage) String() string
- func (x *ClusterMessage) Unmarshal(b []byte) error
- type EdgeNode
- func (x *EdgeNode) DeepCopy(z *EdgeNode)
- func (*EdgeNode) Descriptor() ([]byte, []int)deprecated
- func (x *EdgeNode) GetGatewayAddr() []string
- func (x *EdgeNode) GetRaftPort() uint32
- func (x *EdgeNode) GetRaftState() RaftState
- func (x *EdgeNode) GetReplicaSet() uint64
- func (x *EdgeNode) GetServerID() []byte
- func (x *EdgeNode) GetShardRangeMax() uint32
- func (x *EdgeNode) GetShardRangeMin() uint32
- func (x *EdgeNode) Marshal() ([]byte, error)
- func (*EdgeNode) ProtoMessage()
- func (x *EdgeNode) ProtoReflect() protoreflect.Message
- func (x *EdgeNode) Reset()
- func (x *EdgeNode) String() string
- func (x *EdgeNode) Unmarshal(b []byte) error
- type Error
- func (x *Error) DeepCopy(z *Error)
- func (*Error) Descriptor() ([]byte, []int)deprecated
- func (x *Error) GetCode() string
- func (x *Error) GetItems() string
- func (x *Error) GetLocalTemplate() string
- func (x *Error) GetLocalTemplateItems() []string
- func (x *Error) GetTemplate() string
- func (x *Error) GetTemplateItems() []string
- func (x *Error) Marshal() ([]byte, error)
- func (*Error) ProtoMessage()
- func (x *Error) ProtoReflect() protoreflect.Message
- func (x *Error) Reset()
- func (x *Error) String() string
- func (x *Error) Unmarshal(b []byte) error
- type KeyValue
- func (x *KeyValue) DeepCopy(z *KeyValue)
- func (*KeyValue) Descriptor() ([]byte, []int)deprecated
- func (x *KeyValue) GetKey() string
- func (x *KeyValue) GetValue() string
- func (x *KeyValue) Marshal() ([]byte, error)
- func (*KeyValue) ProtoMessage()
- func (x *KeyValue) ProtoReflect() protoreflect.Message
- func (x *KeyValue) Reset()
- func (x *KeyValue) String() string
- func (x *KeyValue) Unmarshal(b []byte) error
- type MessageContainer
- func (x *MessageContainer) DeepCopy(z *MessageContainer)
- func (*MessageContainer) Descriptor() ([]byte, []int)deprecated
- func (x *MessageContainer) GetEnvelopes() []*MessageEnvelope
- func (x *MessageContainer) GetLength() int32
- func (x *MessageContainer) Marshal() ([]byte, error)
- func (*MessageContainer) ProtoMessage()
- func (x *MessageContainer) ProtoReflect() protoreflect.Message
- func (x *MessageContainer) Reset()
- func (x *MessageContainer) String() string
- func (x *MessageContainer) Unmarshal(b []byte) error
- type MessageEnvelope
- func (x *MessageEnvelope) Clone() *MessageEnvelope
- func (x *MessageEnvelope) DeepCopy(z *MessageEnvelope)
- func (*MessageEnvelope) Descriptor() ([]byte, []int)deprecated
- func (x *MessageEnvelope) Fill(reqID uint64, constructor int64, p proto.Message, kvs ...*KeyValue)
- func (x *MessageEnvelope) Get(key, defaultVal string) string
- func (x *MessageEnvelope) GetAuth() []byte
- func (x *MessageEnvelope) GetConstructor() int64
- func (x *MessageEnvelope) GetHeader() []*KeyValue
- func (x *MessageEnvelope) GetMessage() []byte
- func (x *MessageEnvelope) GetRequestID() uint64
- func (x *MessageEnvelope) Marshal() ([]byte, error)
- func (*MessageEnvelope) ProtoMessage()
- func (x *MessageEnvelope) ProtoReflect() protoreflect.Message
- func (x *MessageEnvelope) Reset()
- func (x *MessageEnvelope) Set(KVs ...*KeyValue)
- func (x *MessageEnvelope) String() string
- func (x *MessageEnvelope) Unmarshal(b []byte) error
- type RaftCommand
- func (x *RaftCommand) DeepCopy(z *RaftCommand)
- func (*RaftCommand) Descriptor() ([]byte, []int)deprecated
- func (x *RaftCommand) Fill(senderID []byte, e *MessageEnvelope, kvs ...*KeyValue)
- func (x *RaftCommand) GetEnvelope() *MessageEnvelope
- func (x *RaftCommand) GetSender() []byte
- func (x *RaftCommand) GetStore() []*KeyValue
- func (x *RaftCommand) Marshal() ([]byte, error)
- func (*RaftCommand) ProtoMessage()
- func (x *RaftCommand) ProtoReflect() protoreflect.Message
- func (x *RaftCommand) Reset()
- func (x *RaftCommand) String() string
- func (x *RaftCommand) Unmarshal(b []byte) error
- type RaftState
- type Redirect
- func (x *Redirect) DeepCopy(z *Redirect)
- func (*Redirect) Descriptor() ([]byte, []int)deprecated
- func (x *Redirect) GetHostPorts() []string
- func (x *Redirect) GetLeaderHostPort() []string
- func (x *Redirect) GetServerID() string
- func (x *Redirect) GetWaitInSec() uint32
- func (x *Redirect) Marshal() ([]byte, error)
- func (*Redirect) ProtoMessage()
- func (x *Redirect) ProtoReflect() protoreflect.Message
- func (x *Redirect) Reset()
- func (x *Redirect) String() string
- func (x *Redirect) Unmarshal(b []byte) error
Constants ¶
View Source
const ( ErrCodeInternal = "E00" // When Error is Unknown or it is internal and should not be exposed to the client ErrCodeInvalid = "E01" ErrCodeTooMany = "E03" ErrCodeTooFew = "E04" ErrCodeIncomplete = "E05" ErrCodeTimeout = "E06" ErrCodeAccess = "E07" ErrCodeAlreadyExists = "E08" ErrCodeBusy = "E09" ErrCodeOutOfRange = "E10" ErrCodePartiallyApplied = "E11" ErrCodeExpired = "E12" ErrCodeNotImplemented = "E13" )
Error Codes
View Source
const ( ErrItemServer = "SERVER" ErrItemRaftLeader = "RAFT_LEADER" ErrItemHandler = "HANDLER" ErrItemRequest = "REQUEST" )
Error Items
View Source
const C_ClusterMessage int64 = 1078766375
View Source
const C_EdgeNode int64 = 999040174
View Source
const C_Error int64 = 2619118453
View Source
const C_KeyValue int64 = 4276272820
View Source
const C_MessageContainer int64 = 1972016308
View Source
const C_MessageEnvelope int64 = 535232465
View Source
const C_RaftCommand int64 = 2919813429
View Source
const C_Redirect int64 = 981138557
Variables ¶
View Source
var ( ErrGatewayAlreadyInitialized = errors.New("gateway already initialized") ErrNotFound = errors.New("not found") ErrNotRaftLeader = errors.New("not raft leader") ErrRaftNotSet = errors.New("raft not set") ErrRaftExecuteOnLeader = errors.New("raft execute on leader") ErrRetriesExceeded = wrapError("maximum retries exceeded") )
Errors
View Source
var ( RaftState_name = map[int32]string{ 0: "None", 1: "Follower", 2: "Candidate", 3: "Leader", 4: "Shutdown", } RaftState_value = map[string]int32{ "None": 0, "Follower": 1, "Candidate": 2, "Leader": 3, "Shutdown": 4, } )
Enum value maps for RaftState.
View Source
var (
ConstructorNames = map[int64]string{}
)
View Source
var File_imsg_proto protoreflect.FileDescriptor
View Source
var File_msg_proto protoreflect.FileDescriptor
View Source
var PoolClusterMessage = poolClusterMessage{}
View Source
var PoolEdgeNode = poolEdgeNode{}
View Source
var PoolError = poolError{}
View Source
var PoolKeyValue = poolKeyValue{}
View Source
var PoolMessageContainer = poolMessageContainer{}
View Source
var PoolMessageEnvelope = poolMessageEnvelope{}
View Source
var PoolRaftCommand = poolRaftCommand{}
View Source
var PoolRedirect = poolRedirect{}
Functions ¶
func ConstructorOf ¶
func ConstructorOf(x interface{}) int64
func ErrorMessage ¶
func ErrorMessage(out *MessageEnvelope, reqID uint64, errCode, errItem string)
func SetLogLevel ¶
func SetLogLevel(l int)
SetLogLevel is used for debugging purpose -1 : DEBUG 0 : INFO 1 : WARN 2 : ERROR
Types ¶
type ClusterMessage ¶
type ClusterMessage struct { Sender []byte `protobuf:"bytes,1,opt,name=Sender,proto3" json:"Sender,omitempty"` Store []*KeyValue `protobuf:"bytes,2,rep,name=Store,proto3" json:"Store,omitempty"` Envelope *MessageEnvelope `protobuf:"bytes,3,opt,name=Envelope,proto3" json:"Envelope,omitempty"` // contains filtered or unexported fields }
ClusterMessage
func (*ClusterMessage) DeepCopy ¶
func (x *ClusterMessage) DeepCopy(z *ClusterMessage)
func (*ClusterMessage) Descriptor
deprecated
func (*ClusterMessage) Descriptor() ([]byte, []int)
Deprecated: Use ClusterMessage.ProtoReflect.Descriptor instead.
func (*ClusterMessage) Fill ¶
func (x *ClusterMessage) Fill(senderID []byte, e *MessageEnvelope, kvs ...*KeyValue)
func (*ClusterMessage) GetEnvelope ¶
func (x *ClusterMessage) GetEnvelope() *MessageEnvelope
func (*ClusterMessage) GetSender ¶
func (x *ClusterMessage) GetSender() []byte
func (*ClusterMessage) GetStore ¶
func (x *ClusterMessage) GetStore() []*KeyValue
func (*ClusterMessage) Marshal ¶ added in v0.0.17
func (x *ClusterMessage) Marshal() ([]byte, error)
func (*ClusterMessage) ProtoMessage ¶
func (*ClusterMessage) ProtoMessage()
func (*ClusterMessage) ProtoReflect ¶
func (x *ClusterMessage) ProtoReflect() protoreflect.Message
func (*ClusterMessage) Reset ¶
func (x *ClusterMessage) Reset()
func (*ClusterMessage) String ¶
func (x *ClusterMessage) String() string
func (*ClusterMessage) Unmarshal ¶
func (x *ClusterMessage) Unmarshal(b []byte) error
type EdgeNode ¶
type EdgeNode struct { ServerID []byte `protobuf:"bytes,1,opt,name=ServerID,proto3" json:"ServerID,omitempty"` ReplicaSet uint64 `protobuf:"varint,2,opt,name=ReplicaSet,proto3" json:"ReplicaSet,omitempty"` ShardRangeMin uint32 `protobuf:"varint,3,opt,name=ShardRangeMin,proto3" json:"ShardRangeMin,omitempty"` ShardRangeMax uint32 `protobuf:"varint,4,opt,name=ShardRangeMax,proto3" json:"ShardRangeMax,omitempty"` RaftPort uint32 `protobuf:"varint,5,opt,name=RaftPort,proto3" json:"RaftPort,omitempty"` RaftState RaftState `protobuf:"varint,6,opt,name=RaftState,proto3,enum=rony.RaftState" json:"RaftState,omitempty"` GatewayAddr []string `protobuf:"bytes,7,rep,name=GatewayAddr,proto3" json:"GatewayAddr,omitempty"` // contains filtered or unexported fields }
EdgeNode
func (*EdgeNode) Descriptor
deprecated
func (*EdgeNode) GetGatewayAddr ¶
func (*EdgeNode) GetRaftPort ¶
func (*EdgeNode) GetRaftState ¶
func (*EdgeNode) GetReplicaSet ¶
func (*EdgeNode) GetServerID ¶
func (*EdgeNode) GetShardRangeMax ¶
func (*EdgeNode) GetShardRangeMin ¶
func (*EdgeNode) ProtoMessage ¶
func (*EdgeNode) ProtoMessage()
func (*EdgeNode) ProtoReflect ¶
func (x *EdgeNode) ProtoReflect() protoreflect.Message
type Error ¶
type Error struct { Code string `protobuf:"bytes,1,opt,name=Code,proto3" json:"Code,omitempty"` Items string `protobuf:"bytes,2,opt,name=Items,proto3" json:"Items,omitempty"` Template string `protobuf:"bytes,3,opt,name=Template,proto3" json:"Template,omitempty"` TemplateItems []string `protobuf:"bytes,4,rep,name=TemplateItems,proto3" json:"TemplateItems,omitempty"` LocalTemplate string `protobuf:"bytes,5,opt,name=LocalTemplate,proto3" json:"LocalTemplate,omitempty"` LocalTemplateItems []string `protobuf:"bytes,6,rep,name=LocalTemplateItems,proto3" json:"LocalTemplateItems,omitempty"` // contains filtered or unexported fields }
Error
func (*Error) Descriptor
deprecated
func (*Error) GetLocalTemplate ¶
func (*Error) GetLocalTemplateItems ¶
func (*Error) GetTemplate ¶
func (*Error) GetTemplateItems ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type KeyValue ¶
type KeyValue struct { Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` Value string `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` // contains filtered or unexported fields }
KeyValue
func (*KeyValue) Descriptor
deprecated
func (*KeyValue) ProtoMessage ¶
func (*KeyValue) ProtoMessage()
func (*KeyValue) ProtoReflect ¶
func (x *KeyValue) ProtoReflect() protoreflect.Message
type MessageContainer ¶
type MessageContainer struct { Length int32 `protobuf:"varint,1,opt,name=Length,proto3" json:"Length,omitempty"` Envelopes []*MessageEnvelope `protobuf:"bytes,2,rep,name=Envelopes,proto3" json:"Envelopes,omitempty"` // contains filtered or unexported fields }
MessageContainer This type of message will be used to send multi messages inside a single container message
func (*MessageContainer) DeepCopy ¶
func (x *MessageContainer) DeepCopy(z *MessageContainer)
func (*MessageContainer) Descriptor
deprecated
func (*MessageContainer) Descriptor() ([]byte, []int)
Deprecated: Use MessageContainer.ProtoReflect.Descriptor instead.
func (*MessageContainer) GetEnvelopes ¶
func (x *MessageContainer) GetEnvelopes() []*MessageEnvelope
func (*MessageContainer) GetLength ¶
func (x *MessageContainer) GetLength() int32
func (*MessageContainer) Marshal ¶ added in v0.0.17
func (x *MessageContainer) Marshal() ([]byte, error)
func (*MessageContainer) ProtoMessage ¶
func (*MessageContainer) ProtoMessage()
func (*MessageContainer) ProtoReflect ¶
func (x *MessageContainer) ProtoReflect() protoreflect.Message
func (*MessageContainer) Reset ¶
func (x *MessageContainer) Reset()
func (*MessageContainer) String ¶
func (x *MessageContainer) String() string
func (*MessageContainer) Unmarshal ¶
func (x *MessageContainer) Unmarshal(b []byte) error
type MessageEnvelope ¶
type MessageEnvelope struct { Constructor int64 `protobuf:"varint,1,opt,name=Constructor,proto3" json:"Constructor,omitempty"` RequestID uint64 `protobuf:"fixed64,2,opt,name=RequestID,proto3" json:"RequestID,omitempty"` Message []byte `protobuf:"bytes,4,opt,name=Message,proto3" json:"Message,omitempty"` Auth []byte `protobuf:"bytes,8,opt,name=Auth,proto3" json:"Auth,omitempty"` Header []*KeyValue `protobuf:"bytes,10,rep,name=Header,proto3" json:"Header,omitempty"` // contains filtered or unexported fields }
MessageEnvelope This type of message will be used to contain another ProtoBuffer Message inside
func (*MessageEnvelope) Clone ¶
func (x *MessageEnvelope) Clone() *MessageEnvelope
func (*MessageEnvelope) DeepCopy ¶
func (x *MessageEnvelope) DeepCopy(z *MessageEnvelope)
func (*MessageEnvelope) Descriptor
deprecated
func (*MessageEnvelope) Descriptor() ([]byte, []int)
Deprecated: Use MessageEnvelope.ProtoReflect.Descriptor instead.
func (*MessageEnvelope) Get ¶ added in v0.0.18
func (x *MessageEnvelope) Get(key, defaultVal string) string
func (*MessageEnvelope) GetAuth ¶
func (x *MessageEnvelope) GetAuth() []byte
func (*MessageEnvelope) GetConstructor ¶
func (x *MessageEnvelope) GetConstructor() int64
func (*MessageEnvelope) GetHeader ¶
func (x *MessageEnvelope) GetHeader() []*KeyValue
func (*MessageEnvelope) GetMessage ¶
func (x *MessageEnvelope) GetMessage() []byte
func (*MessageEnvelope) GetRequestID ¶
func (x *MessageEnvelope) GetRequestID() uint64
func (*MessageEnvelope) Marshal ¶ added in v0.0.17
func (x *MessageEnvelope) Marshal() ([]byte, error)
func (*MessageEnvelope) ProtoMessage ¶
func (*MessageEnvelope) ProtoMessage()
func (*MessageEnvelope) ProtoReflect ¶
func (x *MessageEnvelope) ProtoReflect() protoreflect.Message
func (*MessageEnvelope) Reset ¶
func (x *MessageEnvelope) Reset()
func (*MessageEnvelope) Set ¶ added in v0.0.18
func (x *MessageEnvelope) Set(KVs ...*KeyValue)
func (*MessageEnvelope) String ¶
func (x *MessageEnvelope) String() string
func (*MessageEnvelope) Unmarshal ¶
func (x *MessageEnvelope) Unmarshal(b []byte) error
type RaftCommand ¶
type RaftCommand struct { Sender []byte `protobuf:"bytes,1,opt,name=Sender,proto3" json:"Sender,omitempty"` Store []*KeyValue `protobuf:"bytes,2,rep,name=Store,proto3" json:"Store,omitempty"` Envelope *MessageEnvelope `protobuf:"bytes,3,opt,name=Envelope,proto3" json:"Envelope,omitempty"` // contains filtered or unexported fields }
RaftCommand
func (*RaftCommand) DeepCopy ¶
func (x *RaftCommand) DeepCopy(z *RaftCommand)
func (*RaftCommand) Descriptor
deprecated
func (*RaftCommand) Descriptor() ([]byte, []int)
Deprecated: Use RaftCommand.ProtoReflect.Descriptor instead.
func (*RaftCommand) Fill ¶
func (x *RaftCommand) Fill(senderID []byte, e *MessageEnvelope, kvs ...*KeyValue)
func (*RaftCommand) GetEnvelope ¶
func (x *RaftCommand) GetEnvelope() *MessageEnvelope
func (*RaftCommand) GetSender ¶
func (x *RaftCommand) GetSender() []byte
func (*RaftCommand) GetStore ¶
func (x *RaftCommand) GetStore() []*KeyValue
func (*RaftCommand) Marshal ¶ added in v0.0.17
func (x *RaftCommand) Marshal() ([]byte, error)
func (*RaftCommand) ProtoMessage ¶
func (*RaftCommand) ProtoMessage()
func (*RaftCommand) ProtoReflect ¶
func (x *RaftCommand) ProtoReflect() protoreflect.Message
func (*RaftCommand) Reset ¶
func (x *RaftCommand) Reset()
func (*RaftCommand) String ¶
func (x *RaftCommand) String() string
func (*RaftCommand) Unmarshal ¶
func (x *RaftCommand) Unmarshal(b []byte) error
type RaftState ¶
type RaftState int32
func (RaftState) Descriptor ¶
func (RaftState) Descriptor() protoreflect.EnumDescriptor
func (RaftState) EnumDescriptor
deprecated
func (RaftState) Number ¶
func (x RaftState) Number() protoreflect.EnumNumber
func (RaftState) Type ¶
func (RaftState) Type() protoreflect.EnumType
type Redirect ¶
type Redirect struct { LeaderHostPort []string `protobuf:"bytes,1,rep,name=LeaderHostPort,proto3" json:"LeaderHostPort,omitempty"` HostPorts []string `protobuf:"bytes,2,rep,name=HostPorts,proto3" json:"HostPorts,omitempty"` ServerID string `protobuf:"bytes,3,opt,name=ServerID,proto3" json:"ServerID,omitempty"` WaitInSec uint32 `protobuf:"varint,4,opt,name=WaitInSec,proto3" json:"WaitInSec,omitempty"` // contains filtered or unexported fields }
Redirect
func (*Redirect) Descriptor
deprecated
func (*Redirect) GetHostPorts ¶
func (*Redirect) GetLeaderHostPort ¶
func (*Redirect) GetServerID ¶
func (*Redirect) GetWaitInSec ¶
func (*Redirect) ProtoMessage ¶
func (*Redirect) ProtoMessage()
func (*Redirect) ProtoReflect ¶
func (x *Redirect) ProtoReflect() protoreflect.Message
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
tcp/util
Package wsutil provides utilities for working with WebSocket protocol.
|
Package wsutil provides utilities for working with WebSocket protocol. |
internal
|
|
parser
Package parse builds parse trees for templates as defined by text/template and html/template.
|
Package parse builds parse trees for templates as defined by text/template and html/template. |
repo
|
|
Click to show internal directories.
Click to hide internal directories.