Documentation ¶
Index ¶
- Constants
- Variables
- func New(config config.Config) (server.Plugin, error)
- type APlugin
- func (t *APlugin) HookWrapper() server.HookWrapper
- func (t *APlugin) Load(service server.Server) error
- func (t *APlugin) Name() string
- func (t *APlugin) OnBasicAuthWrapper(pre server.OnBasicAuth) server.OnBasicAuth
- func (t *APlugin) OnClosedWrapper(pre server.OnClosed) server.OnClosed
- func (t *APlugin) OnConnectedWrapper(pre server.OnConnected) server.OnConnected
- func (t *APlugin) OnMsgArrivedWrapper(pre server.OnMsgArrived) server.OnMsgArrived
- func (t *APlugin) OnSubscribeWrapper(pre server.OnSubscribe) server.OnSubscribe
- func (t *APlugin) OnUnsubscribeWrapper(pre server.OnUnsubscribe) server.OnUnsubscribe
- func (t *APlugin) Unload() error
- type AsyncMsg
- type AuthCheck
- type ClosedNotify
- type Config
- type ConnectedNotify
- type DriverClient
- type MsgAckChan
- type PubTopic
- type PublishInfo
- type SubTopic
- type SubTopics
- type ThirdClient
- type UnSubNotify
Constants ¶
View Source
const ( Auth = iota + 1 // 连接鉴权 Sub // 设备订阅校验 Pub // 设备发布校验 UnSub Connected Closed )
View Source
const Name = "aplugin"
Variables ¶
View Source
var DefaultConfig = Config{}
DefaultConfig is the default configuration.
Functions ¶
Types ¶
type APlugin ¶
type APlugin struct {
// contains filtered or unexported fields
}
func (*APlugin) HookWrapper ¶
func (t *APlugin) HookWrapper() server.HookWrapper
func (*APlugin) OnBasicAuthWrapper ¶
func (t *APlugin) OnBasicAuthWrapper(pre server.OnBasicAuth) server.OnBasicAuth
func (*APlugin) OnClosedWrapper ¶
func (*APlugin) OnConnectedWrapper ¶
func (t *APlugin) OnConnectedWrapper(pre server.OnConnected) server.OnConnected
func (*APlugin) OnMsgArrivedWrapper ¶
func (t *APlugin) OnMsgArrivedWrapper(pre server.OnMsgArrived) server.OnMsgArrived
func (*APlugin) OnSubscribeWrapper ¶
func (t *APlugin) OnSubscribeWrapper(pre server.OnSubscribe) server.OnSubscribe
func (*APlugin) OnUnsubscribeWrapper ¶
func (t *APlugin) OnUnsubscribeWrapper(pre server.OnUnsubscribe) server.OnUnsubscribe
type AsyncMsg ¶
type AsyncMsg struct { Id int64 Type int // 1:连接鉴权,2:设备订阅校验,3:设备发布校验,4:unsub,6:closed Data json.RawMessage // auth ack sub ack pub ack }
AsyncMsg 异步消息统一收发
type ClosedNotify ¶
ClosedNotify 三方设备或服务断开连接后通知对应驱动
type Config ¶
type Config struct { }
Config is the configuration for the aplugin plugin.
func (*Config) UnmarshalYAML ¶
type ConnectedNotify ¶
ConnectedNotify 三方设备或服务连接成功后通知对应驱动
type DriverClient ¶
type DriverClient struct { ClientId string Username string PubTopic string SubTopic string ClientMap map[string]*ThirdClient // key is clientId // contains filtered or unexported fields }
func (*DriverClient) AddThirdClient ¶
func (dc *DriverClient) AddThirdClient(client server.Client)
func (*DriverClient) DeleteThirdClient ¶
func (dc *DriverClient) DeleteThirdClient(clientId string)
type MsgAckChan ¶
type PublishInfo ¶
type ThirdClient ¶
type ThirdClient struct {
// contains filtered or unexported fields
}
func (*ThirdClient) AddTopics ¶
func (tc *ThirdClient) AddTopics(topics []string, t int)
func (*ThirdClient) CheckTopic ¶
func (tc *ThirdClient) CheckTopic(topic string, t int) bool
func (*ThirdClient) DeleteTopics ¶
func (tc *ThirdClient) DeleteTopics(topics []string, t int)
type UnSubNotify ¶
Click to show internal directories.
Click to hide internal directories.