mqtt

package module
v0.0.0-...-c396fa1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KindMQTT transport.Kind = "mqtt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	broker.Broker
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) Endpoint

func (s *Server) Endpoint() (*url.URL, error)

func (*Server) InitServer

func (s *Server) InitServer(opts ...ServerOption)

func (*Server) Name

func (s *Server) Name() string

func (*Server) RegisterSubscriber

func (s *Server) RegisterSubscriber(ctx context.Context, topic string, handler broker.Handler, binder broker.Binder, opts ...broker.SubscribeOption) error

func (*Server) Start

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

func (*Server) Stop

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

type ServerOption

type ServerOption func(o *Server)

func Logger

func Logger(logger log.Logger) ServerOption

Logger with server logger. Deprecated: use global logger instead.

func Middleware

func Middleware(m ...middleware.Middleware) ServerOption

Middleware with service md option.

func WithAddress

func WithAddress(addrs []string) ServerOption

func WithAuth

func WithAuth(username string, password string) ServerOption

func WithAutoReconnect

func WithAutoReconnect(enable bool) ServerOption

func WithBrokerOptions

func WithBrokerOptions(opts ...broker.Option) ServerOption

WithBrokerOptions MQ代理配置

func WithCleanSession

func WithCleanSession(enable bool) ServerOption

func WithClientId

func WithClientId(clientId string) ServerOption

func WithCodec

func WithCodec(c string) ServerOption

func WithLogger

func WithLogger(logger log.Logger) ServerOption

func WithResumeSubs

func WithResumeSubs(enable bool) ServerOption

func WithTLSConfig

func WithTLSConfig(c *tls.Config) ServerOption

type SubscribeOption

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

type SubscribeOptionMap

type SubscribeOptionMap map[string]*SubscribeOption

type SubscriberMap

type SubscriberMap map[string]broker.Subscriber

type Transport

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

Transport is an HTTP transport.

func (*Transport) Endpoint

func (tr *Transport) Endpoint() string

Endpoint returns the transport endpoint.

func (*Transport) Kind

func (tr *Transport) Kind() transport.Kind

Kind returns the transport kind.

func (*Transport) Operation

func (tr *Transport) Operation() string

Operation returns the transport operation.

func (*Transport) PathTemplate

func (tr *Transport) PathTemplate() string

PathTemplate returns the http path template.

func (*Transport) ReplyHeader

func (tr *Transport) ReplyHeader() transport.Header

ReplyHeader returns the reply header.

func (*Transport) RequestHeader

func (tr *Transport) RequestHeader() transport.Header

RequestHeader returns the request header.

Jump to

Keyboard shortcuts

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