mqtt

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 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 Option

type Option interface {
	// contains filtered or unexported methods
}

func WithGracePeriod

func WithGracePeriod(t time.Duration) Option

func WithHandler

func WithHandler(handler mqttserver.Handler) Option

func WithIdleTimeout

func WithIdleTimeout(d time.Duration) Option

func WithListen

func WithListen(s string) Option

func WithNetwork

func WithNetwork(s string) Option

func WithReadTimeout

func WithReadTimeout(d time.Duration) Option

func WithReaderBufferSize

func WithReaderBufferSize(i int) Option

func WithTLSConfig

func WithTLSConfig(cfg *tls.Config) Option

func WithWriteTimeout

func WithWriteTimeout(d time.Duration) Option

func WithWriterBufferSize

func WithWriterBufferSize(i int) Option

type Server

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

func New

func New(logger log.Logger, _ *prometheus.Registry, prober *prober.HTTPProbe, opts ...Option) *Server

New creates a new Server.

func (*Server) ActiveConnections

func (s *Server) ActiveConnections() int

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Shutdown

func (s *Server) Shutdown(err error)

Shutdown gracefully shuts down the server by waiting for specified amount of time (by gracePeriod) for connections to return to idle and then shut down.

func (*Server) TotalConnections

func (s *Server) TotalConnections() int64

Jump to

Keyboard shortcuts

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