Documentation ¶
Overview ¶
Package __schema is a generated protocol buffer package.
It is generated from these files:
unitdb.proto
It has these top-level messages:
Empty Packet FixedHeader Connect ConnectAcknowledge PingRequest Disconnect PublishMessage Publish RelayRequest Relay Subscription Subscribe Unsubscribe ControlMessage
Index ¶
- Variables
- func RegisterUnitdbServer(s *grpc.Server, srv UnitdbServer)
- type Connect
- func (*Connect) Descriptor() ([]byte, []int)
- func (m *Connect) GetBatchByteThreshold() int32
- func (m *Connect) GetBatchCountThreshold() int32
- func (m *Connect) GetBatchDuration() int32
- func (m *Connect) GetCleanSessFlag() bool
- func (m *Connect) GetClientID() string
- func (m *Connect) GetInsecureFlag() bool
- func (m *Connect) GetKeepAlive() int32
- func (m *Connect) GetPassword() []byte
- func (m *Connect) GetSessKey() int32
- func (m *Connect) GetUsername() string
- func (m *Connect) GetVersion() int32
- func (*Connect) ProtoMessage()
- func (m *Connect) Reset()
- func (m *Connect) String() string
- type ConnectAcknowledge
- func (*ConnectAcknowledge) Descriptor() ([]byte, []int)
- func (m *ConnectAcknowledge) GetConnID() int32
- func (m *ConnectAcknowledge) GetEpoch() int32
- func (m *ConnectAcknowledge) GetReturnCode() int32
- func (*ConnectAcknowledge) ProtoMessage()
- func (m *ConnectAcknowledge) Reset()
- func (m *ConnectAcknowledge) String() string
- type ControlMessage
- type Disconnect
- type Empty
- type FixedHeader
- func (*FixedHeader) Descriptor() ([]byte, []int)
- func (m *FixedHeader) GetFlowControl() FlowControl
- func (m *FixedHeader) GetMessageLength() int32
- func (m *FixedHeader) GetMessageType() MessageType
- func (*FixedHeader) ProtoMessage()
- func (m *FixedHeader) Reset()
- func (m *FixedHeader) String() string
- type FlowControl
- type MessageType
- type Packet
- type PingRequest
- type Publish
- type PublishMessage
- type Relay
- type RelayRequest
- type Subscribe
- type Subscription
- type UnitdbClient
- type UnitdbServer
- type Unitdb_StreamClient
- type Unitdb_StreamServer
- type Unsubscribe
Constants ¶
This section is empty.
Variables ¶
var FlowControl_name = map[int32]string{
0: "NONE",
1: "ACKNOWLEDGE",
2: "NOTIFY",
3: "RECEIVE",
4: "RECEIPT",
5: "COMPLETE",
}
var FlowControl_value = map[string]int32{
"NONE": 0,
"ACKNOWLEDGE": 1,
"NOTIFY": 2,
"RECEIVE": 3,
"RECEIPT": 4,
"COMPLETE": 5,
}
var MessageType_name = map[int32]string{
0: "RERSERVED",
1: "CONNECT",
2: "PUBLISH",
3: "RELAY",
4: "SUBSCRIBE",
5: "UNSUBSCRIBE",
6: "PINGREQ",
7: "DISCONNECT",
}
var MessageType_value = map[string]int32{
"RERSERVED": 0,
"CONNECT": 1,
"PUBLISH": 2,
"RELAY": 3,
"SUBSCRIBE": 4,
"UNSUBSCRIBE": 5,
"PINGREQ": 6,
"DISCONNECT": 7,
}
Functions ¶
func RegisterUnitdbServer ¶
func RegisterUnitdbServer(s *grpc.Server, srv UnitdbServer)
Types ¶
type Connect ¶
type Connect struct { Version int32 `protobuf:"varint,1,opt,name=Version" json:"Version,omitempty"` InsecureFlag bool `protobuf:"varint,2,opt,name=InsecureFlag" json:"InsecureFlag,omitempty"` ClientID string `protobuf:"bytes,3,opt,name=ClientID" json:"ClientID,omitempty"` KeepAlive int32 `protobuf:"varint,4,opt,name=KeepAlive" json:"KeepAlive,omitempty"` CleanSessFlag bool `protobuf:"varint,5,opt,name=CleanSessFlag" json:"CleanSessFlag,omitempty"` SessKey int32 `protobuf:"varint,6,opt,name=SessKey" json:"SessKey,omitempty"` Username string `protobuf:"bytes,7,opt,name=Username" json:"Username,omitempty"` Password []byte `protobuf:"bytes,8,opt,name=Password,proto3" json:"Password,omitempty"` BatchDuration int32 `protobuf:"varint,9,opt,name=BatchDuration" json:"BatchDuration,omitempty"` BatchByteThreshold int32 `protobuf:"varint,10,opt,name=BatchByteThreshold" json:"BatchByteThreshold,omitempty"` BatchCountThreshold int32 `protobuf:"varint,11,opt,name=BatchCountThreshold" json:"BatchCountThreshold,omitempty"` }
Connect represents a CONNECT Message type.
func (*Connect) Descriptor ¶
func (*Connect) GetBatchByteThreshold ¶
func (*Connect) GetBatchCountThreshold ¶
func (*Connect) GetBatchDuration ¶
func (*Connect) GetCleanSessFlag ¶
func (*Connect) GetClientID ¶
func (*Connect) GetInsecureFlag ¶
func (*Connect) GetKeepAlive ¶
func (*Connect) GetPassword ¶
func (*Connect) GetSessKey ¶
func (*Connect) GetUsername ¶
func (*Connect) GetVersion ¶
func (*Connect) ProtoMessage ¶
func (*Connect) ProtoMessage()
type ConnectAcknowledge ¶
type ConnectAcknowledge struct { ReturnCode int32 `protobuf:"varint,1,opt,name=ReturnCode" json:"ReturnCode,omitempty"` Epoch int32 `protobuf:"varint,2,opt,name=Epoch" json:"Epoch,omitempty"` ConnID int32 `protobuf:"varint,3,opt,name=ConnID" json:"ConnID,omitempty"` }
ConnectAcknowledge represents a CONNECT Acknowledge Message type. 0x00 connection accepted 0x01 refused: unacceptable proto version 0x02 refused: identifier rejected 0x03 refused: unacceptable identifier, access not allowed 0x04 refused server unavailiable 0x05 not authorized 0x06 bad request
func (*ConnectAcknowledge) Descriptor ¶
func (*ConnectAcknowledge) Descriptor() ([]byte, []int)
func (*ConnectAcknowledge) GetConnID ¶
func (m *ConnectAcknowledge) GetConnID() int32
func (*ConnectAcknowledge) GetEpoch ¶
func (m *ConnectAcknowledge) GetEpoch() int32
func (*ConnectAcknowledge) GetReturnCode ¶
func (m *ConnectAcknowledge) GetReturnCode() int32
func (*ConnectAcknowledge) ProtoMessage ¶
func (*ConnectAcknowledge) ProtoMessage()
func (*ConnectAcknowledge) Reset ¶
func (m *ConnectAcknowledge) Reset()
func (*ConnectAcknowledge) String ¶
func (m *ConnectAcknowledge) String() string
type ControlMessage ¶
type ControlMessage struct { MessageID int32 `protobuf:"varint,1,opt,name=MessageID" json:"MessageID,omitempty"` // Optional Control Message bytes Message []byte `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"` }
ControlMessage is a Flow Control Message.
func (*ControlMessage) Descriptor ¶
func (*ControlMessage) Descriptor() ([]byte, []int)
func (*ControlMessage) GetMessage ¶
func (m *ControlMessage) GetMessage() []byte
func (*ControlMessage) GetMessageID ¶
func (m *ControlMessage) GetMessageID() int32
func (*ControlMessage) ProtoMessage ¶
func (*ControlMessage) ProtoMessage()
func (*ControlMessage) Reset ¶
func (m *ControlMessage) Reset()
func (*ControlMessage) String ¶
func (m *ControlMessage) String() string
type Disconnect ¶
type Disconnect struct {
MessageID int32 `protobuf:"varint,1,opt,name=MessageID" json:"MessageID,omitempty"`
}
Disconnect is to signal client want to cease communications with the server.
func (*Disconnect) Descriptor ¶
func (*Disconnect) Descriptor() ([]byte, []int)
func (*Disconnect) GetMessageID ¶
func (m *Disconnect) GetMessageID() int32
func (*Disconnect) ProtoMessage ¶
func (*Disconnect) ProtoMessage()
func (*Disconnect) Reset ¶
func (m *Disconnect) Reset()
func (*Disconnect) String ¶
func (m *Disconnect) String() string
type Empty ¶
type Empty struct { }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
type FixedHeader ¶
type FixedHeader struct { MessageType MessageType `protobuf:"varint,1,opt,name=MessageType,enum=unitdb.schema.MessageType" json:"MessageType,omitempty"` FlowControl FlowControl `protobuf:"varint,2,opt,name=FlowControl,enum=unitdb.schema.FlowControl" json:"FlowControl,omitempty"` MessageLength int32 `protobuf:"varint,3,opt,name=MessageLength" json:"MessageLength,omitempty"` }
func (*FixedHeader) Descriptor ¶
func (*FixedHeader) Descriptor() ([]byte, []int)
func (*FixedHeader) GetFlowControl ¶
func (m *FixedHeader) GetFlowControl() FlowControl
func (*FixedHeader) GetMessageLength ¶
func (m *FixedHeader) GetMessageLength() int32
func (*FixedHeader) GetMessageType ¶
func (m *FixedHeader) GetMessageType() MessageType
func (*FixedHeader) ProtoMessage ¶
func (*FixedHeader) ProtoMessage()
func (*FixedHeader) Reset ¶
func (m *FixedHeader) Reset()
func (*FixedHeader) String ¶
func (m *FixedHeader) String() string
type FlowControl ¶
type FlowControl int32
const ( FlowControl_NONE FlowControl = 0 FlowControl_ACKNOWLEDGE FlowControl = 1 FlowControl_NOTIFY FlowControl = 2 FlowControl_RECEIVE FlowControl = 3 FlowControl_RECEIPT FlowControl = 4 FlowControl_COMPLETE FlowControl = 5 )
func (FlowControl) EnumDescriptor ¶
func (FlowControl) EnumDescriptor() ([]byte, []int)
func (FlowControl) String ¶
func (x FlowControl) String() string
type MessageType ¶
type MessageType int32
const ( MessageType_RERSERVED MessageType = 0 MessageType_CONNECT MessageType = 1 MessageType_PUBLISH MessageType = 2 MessageType_RELAY MessageType = 3 MessageType_SUBSCRIBE MessageType = 4 MessageType_UNSUBSCRIBE MessageType = 5 MessageType_PINGREQ MessageType = 6 MessageType_DISCONNECT MessageType = 7 )
func (MessageType) EnumDescriptor ¶
func (MessageType) EnumDescriptor() ([]byte, []int)
func (MessageType) String ¶
func (x MessageType) String() string
type Packet ¶
type Packet struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}
func (*Packet) Descriptor ¶
func (*Packet) ProtoMessage ¶
func (*Packet) ProtoMessage()
type PingRequest ¶
type PingRequest struct { }
PingRequest is a keepalive
func (*PingRequest) Descriptor ¶
func (*PingRequest) Descriptor() ([]byte, []int)
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) Reset ¶
func (m *PingRequest) Reset()
func (*PingRequest) String ¶
func (m *PingRequest) String() string
type Publish ¶
type Publish struct { MessageID int32 `protobuf:"varint,1,opt,name=MessageID" json:"MessageID,omitempty"` DeliveryMode int32 `protobuf:"varint,2,opt,name=DeliveryMode" json:"DeliveryMode,omitempty"` Messages []*PublishMessage `protobuf:"bytes,3,rep,name=Messages" json:"Messages,omitempty"` }
Publish represents a PUBREQ Message type. It supports following delivery mode. 0 EXPRESS 1 RELIEABLE 2 BATCH
func (*Publish) Descriptor ¶
func (*Publish) GetDeliveryMode ¶
func (*Publish) GetMessageID ¶
func (*Publish) GetMessages ¶
func (m *Publish) GetMessages() []*PublishMessage
func (*Publish) ProtoMessage ¶
func (*Publish) ProtoMessage()
type PublishMessage ¶
type PublishMessage struct { Topic string `protobuf:"bytes,1,opt,name=Topic" json:"Topic,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"` Ttl string `protobuf:"bytes,3,opt,name=Ttl" json:"Ttl,omitempty"` }
func (*PublishMessage) Descriptor ¶
func (*PublishMessage) Descriptor() ([]byte, []int)
func (*PublishMessage) GetPayload ¶
func (m *PublishMessage) GetPayload() []byte
func (*PublishMessage) GetTopic ¶
func (m *PublishMessage) GetTopic() string
func (*PublishMessage) GetTtl ¶
func (m *PublishMessage) GetTtl() string
func (*PublishMessage) ProtoMessage ¶
func (*PublishMessage) ProtoMessage()
func (*PublishMessage) Reset ¶
func (m *PublishMessage) Reset()
func (*PublishMessage) String ¶
func (m *PublishMessage) String() string
type Relay ¶ added in v0.2.0
type Relay struct { MessageID int32 `protobuf:"varint,1,opt,name=MessageID" json:"MessageID,omitempty"` RelayRequests []*RelayRequest `protobuf:"bytes,2,rep,name=relayRequests" json:"relayRequests,omitempty"` }
Relay tells the server which topics and last durations the client would like get data. The Delivery Mode for relay is EXPRESS.
func (*Relay) Descriptor ¶ added in v0.2.0
func (*Relay) GetMessageID ¶ added in v0.2.0
func (*Relay) GetRelayRequests ¶ added in v0.2.0
func (m *Relay) GetRelayRequests() []*RelayRequest
func (*Relay) ProtoMessage ¶ added in v0.2.0
func (*Relay) ProtoMessage()
type RelayRequest ¶ added in v0.2.0
type RelayRequest struct { Topic string `protobuf:"bytes,1,opt,name=Topic" json:"Topic,omitempty"` Last string `protobuf:"bytes,2,opt,name=Last" json:"Last,omitempty"` }
RelayRequest is pairing the Topic and Last parameter together
func (*RelayRequest) Descriptor ¶ added in v0.2.0
func (*RelayRequest) Descriptor() ([]byte, []int)
func (*RelayRequest) GetLast ¶ added in v0.2.0
func (m *RelayRequest) GetLast() string
func (*RelayRequest) GetTopic ¶ added in v0.2.0
func (m *RelayRequest) GetTopic() string
func (*RelayRequest) ProtoMessage ¶ added in v0.2.0
func (*RelayRequest) ProtoMessage()
func (*RelayRequest) Reset ¶ added in v0.2.0
func (m *RelayRequest) Reset()
func (*RelayRequest) String ¶ added in v0.2.0
func (m *RelayRequest) String() string
type Subscribe ¶
type Subscribe struct { MessageID int32 `protobuf:"varint,1,opt,name=MessageID" json:"MessageID,omitempty"` Subscriptions []*Subscription `protobuf:"bytes,2,rep,name=Subscriptions" json:"Subscriptions,omitempty"` }
Subscribe tells the server which topics the client would like to subscribe to and choose a Delivery Mode.
func (*Subscribe) Descriptor ¶
func (*Subscribe) GetMessageID ¶
func (*Subscribe) GetSubscriptions ¶
func (m *Subscribe) GetSubscriptions() []*Subscription
func (*Subscribe) ProtoMessage ¶
func (*Subscribe) ProtoMessage()
type Subscription ¶
type Subscription struct { DeliveryMode int32 `protobuf:"varint,1,opt,name=DeliveryMode" json:"DeliveryMode,omitempty"` Delay int32 `protobuf:"varint,2,opt,name=Delay" json:"Delay,omitempty"` Topic string `protobuf:"bytes,3,opt,name=Topic" json:"Topic,omitempty"` }
Subscription is pairing the Delivery Mode and Topic together for the delivery mode's pairs in unsubscribe and subscribe. Delay in Millisecond to delay the messsage delivery if DeliveryMode is RELIEABLE or BATCH. 0 EXPRESS 1 RELIEABLE 2 BATCH
func (*Subscription) Descriptor ¶
func (*Subscription) Descriptor() ([]byte, []int)
func (*Subscription) GetDelay ¶
func (m *Subscription) GetDelay() int32
func (*Subscription) GetDeliveryMode ¶
func (m *Subscription) GetDeliveryMode() int32
func (*Subscription) GetTopic ¶
func (m *Subscription) GetTopic() string
func (*Subscription) ProtoMessage ¶
func (*Subscription) ProtoMessage()
func (*Subscription) Reset ¶
func (m *Subscription) Reset()
func (*Subscription) String ¶
func (m *Subscription) String() string
type UnitdbClient ¶
type UnitdbClient interface {
Stream(ctx context.Context, opts ...grpc.CallOption) (Unitdb_StreamClient, error)
}
func NewUnitdbClient ¶
func NewUnitdbClient(cc *grpc.ClientConn) UnitdbClient
type UnitdbServer ¶
type UnitdbServer interface {
Stream(Unitdb_StreamServer) error
}
type Unitdb_StreamClient ¶
type Unitdb_StreamServer ¶
type Unsubscribe ¶
type Unsubscribe struct { MessageID int32 `protobuf:"varint,1,opt,name=MessageID" json:"MessageID,omitempty"` Subscriptions []*Subscription `protobuf:"bytes,2,rep,name=Subscriptions" json:"Subscriptions,omitempty"` }
Unsubscribe is the Message to send if you don't want to subscribe to a topic anymore.
func (*Unsubscribe) Descriptor ¶
func (*Unsubscribe) Descriptor() ([]byte, []int)
func (*Unsubscribe) GetMessageID ¶
func (m *Unsubscribe) GetMessageID() int32
func (*Unsubscribe) GetSubscriptions ¶
func (m *Unsubscribe) GetSubscriptions() []*Subscription
func (*Unsubscribe) ProtoMessage ¶
func (*Unsubscribe) ProtoMessage()
func (*Unsubscribe) Reset ¶
func (m *Unsubscribe) Reset()
func (*Unsubscribe) String ¶
func (m *Unsubscribe) String() string