socket

package
v1.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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

type SocketContext struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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) Cleanup

func (s *SocketContext) Cleanup(module string)

Cleanup cleanup

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

Directories

Path Synopsis
modules

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL