amqp

package
v0.0.0-...-648f786 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionLost

type ConnectionLost func(*ramqp.Connection, *ramqp.Error)

type OnConnect

type OnConnect func(*ramqp.Connection)

type Server

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

func NewServer

func NewServer(opts ...ServerOption) *Server

NewServer creates an MQTT server by options.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

type ServerOption

type ServerOption func(*Server)

ServerOption is an MQTT server option.

func ChannelMax

func ChannelMax(channelMax int) ServerOption

ChannelMax 0 max channels means 2^16 - 1

func ConnectionLostHandler

func ConnectionLostHandler(fn ConnectionLost) ServerOption

ConnectionLostHandler is called when the server is disconnected from the client.

func FrameSize

func FrameSize(frameSize int) ServerOption

FrameSize 0 max bytes means unlimited

func Heartbeat

func Heartbeat(heartbeat time.Duration) ServerOption

Heartbeat less than 1s uses the server's interval.

func Locale

func Locale(locale string) ServerOption

Locale with amqp client

func Logger

func Logger(logger log.Logger) ServerOption

Logger with amqp client logger.

func OnConnectHandler

func OnConnectHandler(fn OnConnect) ServerOption

OnConnectHandler is called when the server is connected to the client.

func Properties

func Properties(properties ramqp.Table) ServerOption

Properties

func ReconnectInterval

func ReconnectInterval(interval time.Duration) ServerOption

func SASL

func SASL(sasl []ramqp.Authentication) ServerOption

SASL with amqp client sasl.

func TLSClientConfig

func TLSClientConfig(tlsClientConfig *tls.Config) ServerOption

TLSClientConfig

func Url

func Url(url string) ServerOption

Url with amqp client url.

func Vhost

func Vhost(vhost string) ServerOption

Vhost with amqp client vhost.

Jump to

Keyboard shortcuts

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