Documentation ¶
Index ¶
- Constants
- Variables
- func GenUniqueId() string
- func InitHTTPMoniter(b *Broker)
- func ProcessMessage(msg *Message)
- type Broker
- func (b *Broker) Bridge(e *bridge.Elements)
- func (b *Broker) CheckConnectAuth(clientID, username, password string) bool
- func (b *Broker) DisConnClientByClientId(clientId string)
- func (b *Broker) PublishMessage(packet *packets.PublishPacket)
- func (b *Broker) Start()
- func (b *Broker) StartClientListening(Tls bool)
- func (b *Broker) SubmitWork(clientId string, msg *Message)
- type Cluster
- func (c *Cluster) AddORUpdateAcl(obj *model.Acl)
- func (c *Cluster) AddORUpdateBridge(key string, value string)
- func (c *Cluster) AddORUpdateClient(obj *model.Client)
- func (c *Cluster) AddORUpdateNode(node *model.Node) error
- func (c *Cluster) AddORUpdateSubscription(subscription *model.Subscription)
- func (c *Cluster) AddORUpdateUser(obj *model.User)
- func (c *Cluster) GetAcl(id string) (*model.Acl, error)
- func (c *Cluster) GetAcls() (map[string]*model.Acl, error)
- func (c *Cluster) GetBridge(name string) (string, error)
- func (c *Cluster) GetBridges() (map[string]string, error)
- func (c *Cluster) GetClient(id string) (*model.Client, error)
- func (c *Cluster) GetClients() (map[string]*model.Client, error)
- func (c *Cluster) GetNode(id string) (*model.Node, error)
- func (c *Cluster) GetNodes() (map[string]*model.Node, error)
- func (c *Cluster) GetSubscription(id string) (*model.Subscription, error)
- func (c *Cluster) GetSubscriptions() (map[string]*model.Subscription, error)
- func (c *Cluster) GetUser(name string) (*model.User, error)
- func (c *Cluster) GetUsers() (map[string]*model.User, error)
- func (c *Cluster) LoadAcls()
- func (c *Cluster) LoadBridges()
- func (c *Cluster) LoadClients()
- func (c *Cluster) LoadSubscriptions()
- func (c *Cluster) LoadUsers()
- func (c *Cluster) RegistryNode(node *model.Node, ttl int64)
- func (c *Cluster) RemoveAcl(id string)
- func (c *Cluster) RemoveBridge(key string)
- func (c *Cluster) RemoveClient(id string)
- func (c *Cluster) RemoveNode(id string) error
- func (c *Cluster) RemoveSubscription(subscription *model.Subscription)
- func (c *Cluster) RemoveUser(obj *model.User)
- func (c *Cluster) Start()
- func (c *Cluster) StoreAddORUpdateAcl(obj *model.Acl) error
- func (c *Cluster) StoreAddORUpdateBridge(key string, value string) error
- func (c *Cluster) StoreAddORUpdateClient(obj *model.Client) error
- func (c *Cluster) StoreAddORUpdateSubscription(subscription *model.Subscription) error
- func (c *Cluster) StoreAddORUpdateUser(obj *model.User) error
- func (c *Cluster) StoreRemoveAcl(id string) error
- func (c *Cluster) StoreRemoveBridge(key string) error
- func (c *Cluster) StoreRemoveClient(id string) error
- func (c *Cluster) StoreRemoveSubscription(topic string, clientID string) error
- func (c *Cluster) StoreRemoveUser(user string) error
- type Evt
- type EvtSrc
- type EvtType
- type InflightStatus
- type Message
- type Router
- type Store
Constants ¶
View Source
const ( LOCAL = 0 REMOTE = 1 )
View Source
const ( Connected = 1 Disconnected = 2 )
View Source
const ( // EventTypeNew event type new EventTypeNew = EvtType(0) // EventTypeUpdate event type update EventTypeUpdate = EvtType(1) // EventTypeDelete event type delete EventTypeDelete = EvtType(2) )
View Source
const ( // EventSrcNode node event EventSrcNode = EvtSrc(0) // EventSrcClient client event EventSrcClient = EvtSrc(1) // EventSrcSubscribe subscribe event EventSrcSubscription = EvtSrc(2) EventSrcBridge = EvtSrc(3) EventSrcUser = EvtSrc(4) EventSrcAcl = EvtSrc(5) )
View Source
const ( // ACCEPT_MIN_SLEEP is the minimum acceptable sleep times on temporary errors. ACCEPT_MIN_SLEEP = 100 * time.Millisecond // ACCEPT_MAX_SLEEP is the maximum acceptable sleep times on temporary errors ACCEPT_MAX_SLEEP = 10 * time.Second // DEFAULT_ROUTE_CONNECT Route solicitation intervals. DEFAULT_ROUTE_CONNECT = 5 * time.Second // DEFAULT_TLS_TIMEOUT DEFAULT_TLS_TIMEOUT = 5 * time.Second )
View Source
const ( CONNECT = uint8(iota + 1) CONNACK PUBLISH PUBACK PUBREC PUBREL PUBCOMP SUBSCRIBE SUBACK UNSUBSCRIBE UNSUBACK PINGREQ PINGRESP DISCONNECT )
View Source
const ( QosAtMostOnce byte = iota QosAtLeastOnce QosExactlyOnce QosFailure = 0x80 )
View Source
const ( // DefaultTimeout default timeout DefaultTimeout = time.Second * 3 // DefaultRequestTimeout default request timeout DefaultRequestTimeout = 10 * time.Second // DefaultSlowRequestTime default slow request time DefaultSlowRequestTime = time.Second * 1 )
View Source
const (
Version = "v0.1"
)
Variables ¶
View Source
var ( // TICKER ticket TICKER = time.Second * 3 // TTL timeout TTL = int64(5) )
View Source
var (
DisconnectedPacket = packets.NewControlPacket(packets.Disconnect).(*packets.DisconnectPacket)
)
Functions ¶
func GenUniqueId ¶
func GenUniqueId() string
func InitHTTPMoniter ¶
func InitHTTPMoniter(b *Broker)
func ProcessMessage ¶
func ProcessMessage(msg *Message)
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
var BROKER *Broker
func (*Broker) CheckConnectAuth ¶
func (*Broker) DisConnClientByClientId ¶
func (*Broker) PublishMessage ¶
func (b *Broker) PublishMessage(packet *packets.PublishPacket)
func (*Broker) StartClientListening ¶
func (*Broker) SubmitWork ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func (*Cluster) AddORUpdateAcl ¶
func (*Cluster) AddORUpdateBridge ¶
func (*Cluster) AddORUpdateClient ¶
func (*Cluster) AddORUpdateSubscription ¶
func (c *Cluster) AddORUpdateSubscription(subscription *model.Subscription)
func (*Cluster) AddORUpdateUser ¶
func (*Cluster) GetSubscription ¶
func (c *Cluster) GetSubscription(id string) (*model.Subscription, error)
func (*Cluster) GetSubscriptions ¶
func (c *Cluster) GetSubscriptions() (map[string]*model.Subscription, error)
func (*Cluster) LoadBridges ¶
func (c *Cluster) LoadBridges()
func (*Cluster) LoadClients ¶
func (c *Cluster) LoadClients()
func (*Cluster) LoadSubscriptions ¶
func (c *Cluster) LoadSubscriptions()
func (*Cluster) RemoveBridge ¶
func (*Cluster) RemoveClient ¶
func (*Cluster) RemoveNode ¶
func (*Cluster) RemoveSubscription ¶
func (c *Cluster) RemoveSubscription(subscription *model.Subscription)
func (*Cluster) RemoveUser ¶
func (*Cluster) StoreAddORUpdateBridge ¶
func (*Cluster) StoreAddORUpdateClient ¶
func (*Cluster) StoreAddORUpdateSubscription ¶
func (c *Cluster) StoreAddORUpdateSubscription(subscription *model.Subscription) error
func (*Cluster) StoreAddORUpdateUser ¶
func (*Cluster) StoreRemoveAcl ¶
func (*Cluster) StoreRemoveBridge ¶
func (*Cluster) StoreRemoveClient ¶
func (*Cluster) StoreRemoveSubscription ¶
func (*Cluster) StoreRemoveUser ¶
type InflightStatus ¶
type InflightStatus uint8
const ( Publish InflightStatus = 0 Pubrel InflightStatus = 1 )
Source Files ¶
- auth.go
- bridge.go
- broker.go
- client.go
- cluster.go
- cluster_acl.go
- cluster_bridge.go
- cluster_client.go
- cluster_node.go
- cluster_sub.go
- cluster_user.go
- comm.go
- etcdrouter.go
- etcdstore.go
- http.go
- http_acl.go
- http_bridge.go
- http_client.go
- http_node.go
- http_subscription.go
- http_user.go
- router.go
- sesson.go
- store.go
Click to show internal directories.
Click to hide internal directories.