Documentation ¶
Overview ¶
Copyright 2014, Shuhei Tanuma. All rights reserved. Use of this source code is governed by a MIT license that can be found in the LICENSE file.
Index ¶
- type Connection
- type ConnectionError
- type ConnectionResetError
- type MyConfig
- type MyConnection
- func (self *MyConnection) AppendSubscribedTopic(topic string, set *SubscribeSet)
- func (self *MyConnection) Close() error
- func (self *MyConnection) DisableCleanSession()
- func (self *MyConnection) Disconnect()
- func (self *MyConnection) GetId() string
- func (self *MyConnection) GetOpaque() interface{}
- func (self *MyConnection) GetOutGoingTable() *util.MessageTable
- func (self *MyConnection) GetRealId() string
- func (self *MyConnection) GetState() State
- func (self *MyConnection) GetSubscribedTopics() map[string]*SubscribeSet
- func (self *MyConnection) GetWillMessage() *codec.WillMessage
- func (self *MyConnection) HasMyConnection() bool
- func (self *MyConnection) HasWillMessage() bool
- func (self *MyConnection) IsAlived() bool
- func (self *MyConnection) IsBridge() bool
- func (self *MyConnection) On(event string, callback interface{}, args ...bool) error
- func (self *MyConnection) ParseMessage() (codec.Message, error)
- func (self *MyConnection) Ping()
- func (self *MyConnection) Publish(TopicName string, Payload []byte, QosLevel int, retain bool, ...)
- func (self *MyConnection) Read(p []byte) (int, error)
- func (self *MyConnection) ReadMessage() (codec.Message, error)
- func (self *MyConnection) RemoveSubscribedTopic(topic string)
- func (self *MyConnection) ResetState()
- func (self *MyConnection) SetId(id string)
- func (self *MyConnection) SetKeepaliveInterval(interval int)
- func (self *MyConnection) SetMyConnection(c io.ReadWriteCloser)
- func (self *MyConnection) SetOpaque(opaque interface{})
- func (self *MyConnection) SetRequestPerSecondLimit(limit int)
- func (self *MyConnection) SetState(state State)
- func (self *MyConnection) SetWillMessage(will codec.WillMessage)
- func (self *MyConnection) ShouldCleanSession() bool
- func (self *MyConnection) Subscribe(topic string, QoS int) error
- func (self *MyConnection) Terminate()
- func (self *MyConnection) Unsubscribe(topic string)
- func (self *MyConnection) Write(b []byte) (int, error)
- func (self *MyConnection) WriteMessageQueue(request codec.Message)
- type State
- type SubscribeSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { //WriteMessage(request mqtt.Message) error WriteMessageQueue(request mqtt.Message) Close() error SetState(State) GetState() State ResetState() ReadMessage() (mqtt.Message, error) IsAlived() bool SetWillMessage(mqtt.WillMessage) GetWillMessage() *mqtt.WillMessage HasWillMessage() bool GetOutGoingTable() *util.MessageTable GetSubscribedTopics() map[string]*SubscribeSet AppendSubscribedTopic(string, *SubscribeSet) RemoveSubscribedTopic(string) SetKeepaliveInterval(int) GetId() string GetRealId() string SetId(string) DisableCleanSession() ShouldCleanSession() bool IsBridge() bool }
TODO: あんまり実情にあってないのでみなおそう
type ConnectionError ¶
type ConnectionError struct {
// contains filtered or unexported fields
}
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
type ConnectionResetError ¶
type ConnectionResetError struct {
// contains filtered or unexported fields
}
func (*ConnectionResetError) Error ¶
func (e *ConnectionResetError) Error() string
type MyConfig ¶
type MyConfig struct { QueueSize int MaxMessageSize int OfflineQueueSize int Keepalive int WritePerSec int Logger log.Logger }
func GetDefaultMyConfig ¶
func GetDefaultMyConfig() *MyConfig
type MyConnection ¶
type MyConnection struct { MyConnection io.ReadWriteCloser Events map[string]interface{} Queue chan codec.Message OfflineQueue []codec.Message MaxOfflineQueue int InflightTable *util.MessageTable SubscribeHistory map[string]int PingCounter int Reconnect bool Mutex sync.RWMutex Kicker *time.Timer Keepalive int Id string Qlobber *util.Qlobber WillMessage *codec.WillMessage SubscribedTopics map[string]int Opaque interface{} Last time.Time State State CleanSession bool Connected bool Closed chan bool Reader *bufio.Reader Writer *bufio.Writer KeepLoop bool MaxMessageSize int Bridged bool // contains filtered or unexported fields }
func (*MyConnection) AppendSubscribedTopic ¶
func (self *MyConnection) AppendSubscribedTopic(topic string, set *SubscribeSet)
func (*MyConnection) Close ¶
func (self *MyConnection) Close() error
func (*MyConnection) DisableCleanSession ¶
func (self *MyConnection) DisableCleanSession()
func (*MyConnection) Disconnect ¶
func (self *MyConnection) Disconnect()
func (*MyConnection) GetId ¶
func (self *MyConnection) GetId() string
func (*MyConnection) GetOpaque ¶
func (self *MyConnection) GetOpaque() interface{}
func (*MyConnection) GetOutGoingTable ¶
func (self *MyConnection) GetOutGoingTable() *util.MessageTable
func (*MyConnection) GetRealId ¶
func (self *MyConnection) GetRealId() string
func (*MyConnection) GetState ¶
func (self *MyConnection) GetState() State
func (*MyConnection) GetSubscribedTopics ¶
func (self *MyConnection) GetSubscribedTopics() map[string]*SubscribeSet
func (*MyConnection) GetWillMessage ¶
func (self *MyConnection) GetWillMessage() *codec.WillMessage
func (*MyConnection) HasMyConnection ¶
func (self *MyConnection) HasMyConnection() bool
func (*MyConnection) HasWillMessage ¶
func (self *MyConnection) HasWillMessage() bool
func (*MyConnection) IsAlived ¶
func (self *MyConnection) IsAlived() bool
func (*MyConnection) IsBridge ¶
func (self *MyConnection) IsBridge() bool
func (*MyConnection) On ¶
func (self *MyConnection) On(event string, callback interface{}, args ...bool) error
func (*MyConnection) ParseMessage ¶
func (self *MyConnection) ParseMessage() (codec.Message, error)
func (*MyConnection) Ping ¶
func (self *MyConnection) Ping()
func (*MyConnection) Publish ¶
func (self *MyConnection) Publish(TopicName string, Payload []byte, QosLevel int, retain bool, opaque interface{})
func (*MyConnection) ReadMessage ¶
func (self *MyConnection) ReadMessage() (codec.Message, error)
func (*MyConnection) RemoveSubscribedTopic ¶
func (self *MyConnection) RemoveSubscribedTopic(topic string)
func (*MyConnection) ResetState ¶
func (self *MyConnection) ResetState()
func (*MyConnection) SetId ¶
func (self *MyConnection) SetId(id string)
func (*MyConnection) SetKeepaliveInterval ¶
func (self *MyConnection) SetKeepaliveInterval(interval int)
func (*MyConnection) SetMyConnection ¶
func (self *MyConnection) SetMyConnection(c io.ReadWriteCloser)
func (*MyConnection) SetOpaque ¶
func (self *MyConnection) SetOpaque(opaque interface{})
func (*MyConnection) SetRequestPerSecondLimit ¶
func (self *MyConnection) SetRequestPerSecondLimit(limit int)
func (*MyConnection) SetState ¶
func (self *MyConnection) SetState(state State)
func (*MyConnection) SetWillMessage ¶
func (self *MyConnection) SetWillMessage(will codec.WillMessage)
func (*MyConnection) ShouldCleanSession ¶
func (self *MyConnection) ShouldCleanSession() bool
func (*MyConnection) Terminate ¶
func (self *MyConnection) Terminate()
func (*MyConnection) Unsubscribe ¶
func (self *MyConnection) Unsubscribe(topic string)
func (*MyConnection) WriteMessageQueue ¶
func (self *MyConnection) WriteMessageQueue(request codec.Message)
type SubscribeSet ¶
type SubscribeSet struct { ClientId string `json:"client_id"` TopicFilter string `json:"topic_filter"` QoS int `json:"qos"` }
func (*SubscribeSet) String ¶
func (self *SubscribeSet) String() string
Click to show internal directories.
Click to hide internal directories.