Documentation
¶
Index ¶
- Constants
- func SyncInvoker(invoker Invoker, param *InvokeParam, on OnResult, timeout time.Duration) error
- type InvokeParam
- type Invoker
- type MethodRequest
- type MultiSubscribe
- type OnResult
- type OnServiceUp
- type Register
- type SLink
- func (p *SLink) Connect() (MQTT.Client, error)
- func (p *SLink) GetClient() MQTT.Client
- func (p *SLink) InitRpcClient(serviceName string) (Invoker, error)
- func (p *SLink) InitRpcServer(serviceName string) (Register, error)
- func (p *SLink) NewMultiSubscribe(topic string) (*MultiSubscribe, error)
- func (p *SLink) NewMultiSubscribes(topics []string) (map[string]*MultiSubscribe, error)
- func (p *SLink) NewRpcClients(svcnames []string) (map[string]Invoker, error)
- func (p *SLink) ProvideService(sInfo *ServiceInfo)
- func (p *SLink) Publish(topic string, msg string) error
- func (p *SLink) SetDeadTime(t time.Duration) *SLink
- func (p *SLink) SetKeepAlive(t time.Duration) *SLink
- func (p *SLink) SetOnServiceUp(serviceName string, onServiceUp OnServiceUp) (ServiceGetter, error)
- func (p *SLink) SetPassword(password string) *SLink
- func (p *SLink) SetUserName(name string) *SLink
- func (p *SLink) Subscribe(topic string, th TopicHandler) error
- func (p *SLink) Unsubscribe(topic string) error
- type ServiceGetter
- type ServiceInfo
- type TopicHandler
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func SyncInvoker ¶
Types ¶
type InvokeParam ¶
type MethodRequest ¶
type MultiSubscribe ¶
type MultiSubscribe struct { Subscribe func(lis *TopicHandler) Unsubscribe func(lis *TopicHandler) }
type OnServiceUp ¶
type OnServiceUp func(p *ServiceInfo)
type Register ¶
type Register func(method string, f MethodRequest)
type SLink ¶
type SLink struct {
// contains filtered or unexported fields
}
func (*SLink) NewMultiSubscribe ¶
func (p *SLink) NewMultiSubscribe(topic string) (*MultiSubscribe, error)
func (*SLink) NewMultiSubscribes ¶
func (p *SLink) NewMultiSubscribes(topics []string) (map[string]*MultiSubscribe, error)
func (*SLink) NewRpcClients ¶
func (*SLink) ProvideService ¶
func (p *SLink) ProvideService(sInfo *ServiceInfo)
func (*SLink) SetOnServiceUp ¶
func (p *SLink) SetOnServiceUp(serviceName string, onServiceUp OnServiceUp) (ServiceGetter, error)
func (*SLink) SetPassword ¶
func (*SLink) SetUserName ¶
func (*SLink) Unsubscribe ¶
type ServiceGetter ¶
type ServiceGetter func() *ServiceInfo
type ServiceInfo ¶
type TopicHandler ¶
type TopicHandler func(msg []byte)
Click to show internal directories.
Click to hide internal directories.