broker

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectFunc

type ConnectFunc func(ConnectOptions) (interface{}, error)

ConnectFunc connect func

type ConnectOptions

type ConnectOptions struct {
	Address     string
	MessageType string
	BufferSize  int
	Cert        tls.Certificate

	// for websocket/http
	RequestHeader http.Header
}

ConnectOptions connect options

type RemoteBroker

type RemoteBroker struct {
	// contains filtered or unexported fields
}

RemoteBroker remote broker

func NewRemoteBroker

func NewRemoteBroker() *RemoteBroker

NewRemoteBroker new remote broker

func (*RemoteBroker) Connect

func (broker *RemoteBroker) Connect(opts ConnectOptions, connect ConnectFunc) wrapper.Conn

Connect connect

func (*RemoteBroker) Receive

func (broker *RemoteBroker) Receive(conn wrapper.Conn) (model.Message, error)

Receive receive

func (*RemoteBroker) Send

func (broker *RemoteBroker) Send(conn wrapper.Conn, message model.Message) error

Send send

func (*RemoteBroker) SendSync

func (broker *RemoteBroker) SendSync(conn wrapper.Conn, message model.Message, timeout time.Duration) (model.Message, error)

SendSync sync mode

func (*RemoteBroker) SendSyncInternal

func (broker *RemoteBroker) SendSyncInternal(conn wrapper.Conn, message model.Message, timeout time.Duration) (model.Message, error)

SendSyncInternal sync mode

Jump to

Keyboard shortcuts

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