Documentation
¶
Index ¶
- Constants
- func GetConnectFunc(moduleType string) broker.ConnectFunc
- func SocketConnect(opts broker.ConnectOptions) (interface{}, error)
- type ModuleExchange
- type SocketContext
- func (s *SocketContext) AddModule(info *common.ModuleInfo)
- func (s *SocketContext) AddModuleGroup(module, group string)
- func (s *SocketContext) Cleanup(module string)
- func (s *SocketContext) Receive(module string) (model.Message, error)
- func (s *SocketContext) Send(module string, message model.Message)
- func (s *SocketContext) SendResp(message model.Message)
- func (s *SocketContext) SendSync(module string, message model.Message, timeout time.Duration) (model.Message, error)
- func (s *SocketContext) SendToGroup(group string, message model.Message)
- func (s *SocketContext) SendToGroupSync(module string, message model.Message, timeout time.Duration) error
Constants ¶
View Source
const ( // TODO: configurable HandshakeTimeout = 60 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func GetConnectFunc ¶
func GetConnectFunc(moduleType string) broker.ConnectFunc
GetConnectFunc get connect func
func SocketConnect ¶
func SocketConnect(opts broker.ConnectOptions) (interface{}, error)
SocketConnect socket connect
Types ¶
type ModuleExchange ¶
type ModuleExchange struct {
Modules []string `json:"modules"`
Groups map[string][]string `json:"groups"`
}
ModuleExchange module exchange
type SocketContext ¶
func InitSocketContext ¶
func InitSocketContext() *SocketContext
func (*SocketContext) AddModule ¶
func (s *SocketContext) AddModule(info *common.ModuleInfo)
func (*SocketContext) AddModuleGroup ¶
func (s *SocketContext) AddModuleGroup(module, group string)
AddModuleGroup add module group
func (*SocketContext) Receive ¶
func (s *SocketContext) Receive(module string) (model.Message, error)
Receive receive
func (*SocketContext) Send ¶
func (s *SocketContext) Send(module string, message model.Message)
Send send
func (*SocketContext) SendResp ¶
func (s *SocketContext) SendResp(message model.Message)
SendResp send the response that got by NewRespByMessage
func (*SocketContext) SendSync ¶
func (s *SocketContext) SendSync(module string, message model.Message, timeout time.Duration) (model.Message, error)
SendSync send sync
func (*SocketContext) SendToGroup ¶
func (s *SocketContext) SendToGroup(group string, message model.Message)
SendToGroup send to group
func (*SocketContext) SendToGroupSync ¶
func (s *SocketContext) SendToGroupSync(module string, message model.Message, timeout time.Duration) error
SendToGroupSync send to group sync
Click to show internal directories.
Click to hide internal directories.