socket

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 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 Connect added in v1.10.3

func Connect(opts broker.ConnectOptions) (interface{}, error)

Connect socket connect

func GetConnectFunc

func GetConnectFunc(moduleType string) broker.ConnectFunc

GetConnectFunc get connect func

Types

type Context added in v1.10.3

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

Context is object for Context Socket

func InitSocketContext

func InitSocketContext() *Context

func (*Context) AddModule added in v1.10.3

func (s *Context) AddModule(info *common.ModuleInfo)

func (*Context) AddModuleGroup added in v1.10.3

func (s *Context) AddModuleGroup(module, group string)

AddModuleGroup add module group

func (*Context) Cleanup added in v1.10.3

func (s *Context) Cleanup(module string)

Cleanup cleanup

func (*Context) Receive added in v1.10.3

func (s *Context) Receive(module string) (model.Message, error)

Receive receive

func (*Context) Send added in v1.10.3

func (s *Context) Send(module string, message model.Message)

Send send

func (*Context) SendResp added in v1.10.3

func (s *Context) SendResp(message model.Message)

SendResp send the response that got by NewRespByMessage

func (*Context) SendSync added in v1.10.3

func (s *Context) SendSync(module string, message model.Message, timeout time.Duration) (model.Message, error)

SendSync send sync

func (*Context) SendToGroup added in v1.10.3

func (s *Context) SendToGroup(group string, message model.Message)

SendToGroup send to group

func (*Context) SendToGroupSync added in v1.10.3

func (s *Context) SendToGroupSync(module string, message model.Message, timeout time.Duration) error

SendToGroupSync send to group sync

type ModuleExchange

type ModuleExchange struct {
	Modules []string            `json:"modules"`
	Groups  map[string][]string `json:"groups"`
}

ModuleExchange module exchange

Directories

Path Synopsis
modules

Jump to

Keyboard shortcuts

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