Documentation ¶
Index ¶
- Constants
- Variables
- type Cluster
- func (c *Cluster) Broadcast(data []byte) error
- func (c *Cluster) Broker() *mqttor.Server
- func (c *Cluster) GetHook() *Hook
- func (c *Cluster) Name() string
- func (c *Cluster) ProcessMessage(data []byte) error
- func (c *Cluster) Publish(topic string, payload []byte, retain bool, qos byte) error
- func (c *Cluster) Serve() error
- func (c *Cluster) Stop() error
- type Delegate
- type Event
- type Hook
- func (h *Hook) ID() string
- func (h *Hook) Init(config any) error
- func (h *Hook) OnDisconnect(cl *mqttor.Client, err error, expire bool)
- func (h *Hook) OnPublish(cl *mqttor.Client, pk packets.Packet) (packets.Packet, error)
- func (h *Hook) OnSessionEstablished(cl *mqttor.Client, pk packets.Packet)
- func (h *Hook) OnWillSent(cl *mqttor.Client, pk packets.Packet)
- func (h *Hook) Provides(b byte) bool
- func (h *Hook) SetOpts(l *zerolog.Logger, opts *mqttor.HookOptions)
- type Msg
- type Opt
- type OptItem
- type Options
Constants ¶
View Source
const ( TypPublish = 100 TypConnect = 100 + iota TypDisconnect )
Variables ¶
View Source
var ( ErrInvalidMessageData = packets.Code{Code: 0xD0, Reason: "invalid cluster message"} ErrInvalidBroker = packets.Code{Code: 0xD1, Reason: "invalid broker, broker must not be nil"} )
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Opt *Opt Event *Event Delegate *Delegate List *memberlist.Memberlist Queue *memberlist.TransmitLimitedQueue Hook *Hook }
func (*Cluster) ProcessMessage ¶
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶
func (*Delegate) GetBroadcasts ¶
func (*Delegate) LocalState ¶
func (*Delegate) MergeRemoteState ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (*Event) NotifyJoin ¶
func (e *Event) NotifyJoin(node *memberlist.Node)
func (*Event) NotifyLeave ¶
func (e *Event) NotifyLeave(node *memberlist.Node)
func (*Event) NotifyUpdate ¶
func (e *Event) NotifyUpdate(node *memberlist.Node)
type Hook ¶
Hook is a debugging hook which logs additional low-level information from the server.
func (*Hook) OnSessionEstablished ¶
type Opt ¶
type Opt struct { Name string Addr string AdvertiseAddr string Members string Log *zerolog.Logger Broker *mqttor.Server }
func DefaultOption ¶
func DefaultOption() *Opt
type OptItem ¶
type OptItem func(opt *Opt)
func OptAdvertiseAddr ¶ added in v1.0.2
func OptMembers ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.