Documentation ¶
Index ¶
- type ConnectionLost
- type OnConnect
- type Server
- type ServerOption
- func ChannelMax(channelMax int) ServerOption
- func ConnectionLostHandler(fn ConnectionLost) ServerOption
- func FrameSize(frameSize int) ServerOption
- func Heartbeat(heartbeat time.Duration) ServerOption
- func Locale(locale string) ServerOption
- func Logger(logger log.Logger) ServerOption
- func OnConnectHandler(fn OnConnect) ServerOption
- func Properties(properties ramqp.Table) ServerOption
- func ReconnectInterval(interval time.Duration) ServerOption
- func SASL(sasl []ramqp.Authentication) ServerOption
- func TLSClientConfig(tlsClientConfig *tls.Config) ServerOption
- func Url(url string) ServerOption
- func Vhost(vhost string) ServerOption
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.
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 Heartbeat ¶
func Heartbeat(heartbeat time.Duration) ServerOption
Heartbeat less than 1s uses the server's interval.
func OnConnectHandler ¶
func OnConnectHandler(fn OnConnect) ServerOption
OnConnectHandler is called when the server is connected to the client.
func ReconnectInterval ¶
func ReconnectInterval(interval time.Duration) ServerOption
func TLSClientConfig ¶
func TLSClientConfig(tlsClientConfig *tls.Config) ServerOption
TLSClientConfig
Click to show internal directories.
Click to hide internal directories.