Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsWildcard(topic string) bool
- func PubTopicValidate(topic string) bool
- func SubTopicValidate(topic string) bool
- func TopicIsMatch(topic string, topicRule string) bool
- type AckV2
- type Acknowledge
- type Flow
- type Message
- type MsgAck
- type PacketIDS
- type Persisted
- func (*Persisted) Descriptor() ([]byte, []int)
- func (m *Persisted) GetClientID() string
- func (m *Persisted) GetPayload() []byte
- func (m *Persisted) GetQOS() uint32
- func (m *Persisted) GetTopic() string
- func (*Persisted) ProtoMessage()
- func (m *Persisted) Reset()
- func (m *Persisted) String() string
- func (m *Persisted) XXX_DiscardUnknown()
- func (m *Persisted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Persisted) XXX_Merge(src proto.Message)
- func (m *Persisted) XXX_Size() int
- func (m *Persisted) XXX_Unmarshal(b []byte) error
- type Publish
- type Subscribe
- type Transferred
- func (*Transferred) Descriptor() ([]byte, []int)
- func (m *Transferred) GetFunctionInstanceID() string
- func (m *Transferred) GetFunctionInvokeID() string
- func (m *Transferred) GetFunctionName() string
- func (m *Transferred) GetPersisted() *Persisted
- func (*Transferred) ProtoMessage()
- func (m *Transferred) Reset()
- func (m *Transferred) String() string
- func (m *Transferred) XXX_DiscardUnknown()
- func (m *Transferred) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Transferred) XXX_Merge(src proto.Message)
- func (m *Transferred) XXX_Size() int
- func (m *Transferred) XXX_Unmarshal(b []byte) error
Constants ¶
const ( // topic validate fields MaxSlashCount = 8 MaxTopicNameLen = 255 MaxPayloadLengthString = "Byte" // wildcard topic fields TopicSeparator = "/" SingleWildCard = "+" MultipleWildCard = "#" SysCmdPrefix = "$" FuncTopicPrefix = "$function/" RemoteTopicPrefix = "$remote/" PrefixSub = "sub." PrefixPub = "pub." PrefixSess = "$session/" PrefixTmp = "$session/tmp/" RuleMsgQ0 = "$rule/msgqos0" RuleTopic = "$rule/topic" )
common
Variables ¶
var ( // BucketNameDotSubscription stores session's subscription BucketNameDotSubscription = []byte(".subscription") // BucketNameDotRetained stores session's retained message BucketNameDotRetained = []byte(".retained") // BucketNameDotWill stores session's will message ? BucketNameDotWill = []byte(".will") // BucketNameDotAuth stores auth data BucketNameDotAuth = []byte(".auth") // BucketNameDotMapping stores topic mappings BucketNameDotMapping = []byte(".mapping") )
Queue的Bucket名字不能包含'.',非Queue(特别是metadata)的Bucket命名推荐'.'起头
var ( SubTopicSysRemoteFormat = "$SYS/remote/%s/%s" SubTopicSysFuncPrefix = "$SYS/function/" SubTypeFunc = "function" SubTypeRemote = "remote" )
Subscription
Functions ¶
func ContainsWildcard ¶
ContainsWildcard check topic contains wildCard("#" or "+") or not
func PubTopicValidate ¶
PubTopicValidate validate MQTT publish topic
func SubTopicValidate ¶
SubTopicValidate validate MQTT subscribe topic
func TopicIsMatch ¶
TopicIsMatch check the given topicRule is matched the given topic or not
Types ¶
type Acknowledge ¶
type Acknowledge struct {
// contains filtered or unexported fields
}
Acknowledge acknowledgement
func NewAcknowledge ¶
func NewAcknowledge() *Acknowledge
NewAcknowledge creates a new acknowledgement
func (*Acknowledge) Wait ¶
func (ack *Acknowledge) Wait(cancel <-chan struct{}) bool
Wait waits until acknowledged or cancelled
type Message ¶
type Message struct { Persisted TargetQOS uint32 TargetTopic string Barrier bool Retain bool PacketID uint32 SequenceID uint64 // contains filtered or unexported fields }
Message MQTT message with client ID
func NewMessage ¶
NewMessage creates a message
func UnmarshalMessage ¶
UnmarshalMessage creates a message by persisted data
func (*Message) CallbackPID ¶
func (m *Message) CallbackPID()
CallbackPID calls the callback with packet id
func (*Message) SetCallbackPID ¶
SetCallbackPID sets packet id and its callback
func (*Message) SetCallbackSID ¶
SetCallbackSID sets sequence id and its callback
type PacketIDS ¶
PacketIDS generates packet id by sequence id for message
type Persisted ¶
type Persisted struct { QOS uint32 `protobuf:"varint,1,opt,name=QOS,proto3" json:"QOS,omitempty"` Topic string `protobuf:"bytes,2,opt,name=Topic,proto3" json:"Topic,omitempty"` Payload []byte `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"` ClientID string `protobuf:"bytes,4,opt,name=ClientID,proto3" json:"ClientID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Persisted) Descriptor ¶
func (*Persisted) GetClientID ¶
func (*Persisted) GetPayload ¶
func (*Persisted) ProtoMessage ¶
func (*Persisted) ProtoMessage()
func (*Persisted) XXX_DiscardUnknown ¶
func (m *Persisted) XXX_DiscardUnknown()
func (*Persisted) XXX_Marshal ¶
func (*Persisted) XXX_Unmarshal ¶
type Subscribe ¶
type Subscribe struct {
// contains filtered or unexported fields
}
Subscribe MQTT subscribe
type Transferred ¶
type Transferred struct { Persisted *Persisted `protobuf:"bytes,1,opt,name=Persisted,proto3" json:"Persisted,omitempty"` FunctionName string `protobuf:"bytes,2,opt,name=FunctionName,proto3" json:"FunctionName,omitempty"` FunctionInvokeID string `protobuf:"bytes,3,opt,name=FunctionInvokeID,proto3" json:"FunctionInvokeID,omitempty"` FunctionInstanceID string `protobuf:"bytes,4,opt,name=FunctionInstanceID,proto3" json:"FunctionInstanceID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Transferred) Descriptor ¶
func (*Transferred) Descriptor() ([]byte, []int)
func (*Transferred) GetFunctionInstanceID ¶
func (m *Transferred) GetFunctionInstanceID() string
func (*Transferred) GetFunctionInvokeID ¶
func (m *Transferred) GetFunctionInvokeID() string
func (*Transferred) GetFunctionName ¶
func (m *Transferred) GetFunctionName() string
func (*Transferred) GetPersisted ¶
func (m *Transferred) GetPersisted() *Persisted
func (*Transferred) ProtoMessage ¶
func (*Transferred) ProtoMessage()
func (*Transferred) Reset ¶
func (m *Transferred) Reset()
func (*Transferred) String ¶
func (m *Transferred) String() string
func (*Transferred) XXX_DiscardUnknown ¶
func (m *Transferred) XXX_DiscardUnknown()
func (*Transferred) XXX_Marshal ¶
func (m *Transferred) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Transferred) XXX_Merge ¶
func (dst *Transferred) XXX_Merge(src proto.Message)
func (*Transferred) XXX_Size ¶
func (m *Transferred) XXX_Size() int
func (*Transferred) XXX_Unmarshal ¶
func (m *Transferred) XXX_Unmarshal(b []byte) error