Documentation ¶
Overview ¶
Package broker is a generated protocol buffer package.
It is generated from these files:
events.proto
It has these top-level messages:
MessagePublished
Index ¶
- type Broker
- func (b *Broker) Authenticate(transport listener.Transport, sessionID, username string, password string) (tenant string, id string, err error)
- func (b *Broker) Join(hosts []string)
- func (b *Broker) ListRetainedMessages() (topics.RetainedMessageList, error)
- func (b *Broker) ListSessions() (sessions.SessionList, error)
- func (b *Broker) ListSubscriptions() (subscriptions.SubscriptionList, error)
- func (b *Broker) OnBrokerStopped(f func()) func()
- func (b *Broker) OnConnect(transportSession *listener.Session)
- func (b *Broker) OnMessagePublished(recipient string, f func(p *packet.Publish)) func()
- func (b *Broker) OnPublish(id, tenant string, packet *packet.Publish) error
- func (b *Broker) OnSessionClosed(id, tenant string)
- func (b *Broker) OnSessionLost(id, tenant string)
- func (b *Broker) OnSubscribe(id string, tenant string, packet *packet.Subscribe) error
- func (b *Broker) OnUnsubscribe(id string, tenant string, packet *packet.Unsubscribe) error
- func (b *Broker) Stop()
- type Config
- type MessagePublished
- func (*MessagePublished) Descriptor() ([]byte, []int)
- func (m *MessagePublished) GetDup() bool
- func (m *MessagePublished) GetPayload() []byte
- func (m *MessagePublished) GetQos() []int32
- func (m *MessagePublished) GetRecipient() []string
- func (m *MessagePublished) GetRetained() bool
- func (m *MessagePublished) GetTopic() []byte
- func (*MessagePublished) ProtoMessage()
- func (m *MessagePublished) Reset()
- func (m *MessagePublished) String() string
- type SessionConfig
- type SessionStore
- type SubscriptionStore
- type TopicStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { Peer *peer.Peer Subscriptions SubscriptionStore Sessions SessionStore Topics TopicStore Listener io.Closer TCPTransport io.Closer TLSTransport io.Closer WSSTransport io.Closer RPC io.Closer // contains filtered or unexported fields }
func (*Broker) Authenticate ¶
func (*Broker) ListRetainedMessages ¶
func (b *Broker) ListRetainedMessages() (topics.RetainedMessageList, error)
func (*Broker) ListSessions ¶
func (b *Broker) ListSessions() (sessions.SessionList, error)
func (*Broker) ListSubscriptions ¶
func (b *Broker) ListSubscriptions() (subscriptions.SubscriptionList, error)
func (*Broker) OnBrokerStopped ¶ added in v0.0.9
func (b *Broker) OnBrokerStopped(f func()) func()
func (*Broker) OnMessagePublished ¶ added in v0.0.9
func (*Broker) OnSessionClosed ¶
func (*Broker) OnSessionLost ¶
func (*Broker) OnSubscribe ¶
func (*Broker) OnUnsubscribe ¶
type Config ¶
type Config struct { TCPPort int TLS *tls.Config TLSPort int WSSPort int RPCPort int GossipPort int AuthHelper func(transport listener.Transport, sessionID, username string, password string) (tenant string, id string, err error) Session SessionConfig }
func DefaultConfig ¶
func DefaultConfig() Config
type MessagePublished ¶
type MessagePublished struct { Recipient []string `protobuf:"bytes,1,rep,name=Recipient" json:"Recipient,omitempty"` Topic []byte `protobuf:"bytes,2,opt,name=Topic,proto3" json:"Topic,omitempty"` Qos []int32 `protobuf:"varint,3,rep,packed,name=Qos" json:"Qos,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` Retained bool `protobuf:"varint,5,opt,name=Retained" json:"Retained,omitempty"` Dup bool `protobuf:"varint,6,opt,name=Dup" json:"Dup,omitempty"` }
func (*MessagePublished) Descriptor ¶
func (*MessagePublished) Descriptor() ([]byte, []int)
func (*MessagePublished) GetDup ¶
func (m *MessagePublished) GetDup() bool
func (*MessagePublished) GetPayload ¶
func (m *MessagePublished) GetPayload() []byte
func (*MessagePublished) GetQos ¶
func (m *MessagePublished) GetQos() []int32
func (*MessagePublished) GetRecipient ¶
func (m *MessagePublished) GetRecipient() []string
func (*MessagePublished) GetRetained ¶
func (m *MessagePublished) GetRetained() bool
func (*MessagePublished) GetTopic ¶
func (m *MessagePublished) GetTopic() []byte
func (*MessagePublished) ProtoMessage ¶
func (*MessagePublished) ProtoMessage()
func (*MessagePublished) Reset ¶
func (m *MessagePublished) Reset()
func (*MessagePublished) String ¶
func (m *MessagePublished) String() string
type SessionConfig ¶ added in v0.0.9
type SessionConfig struct {
MaxInflightSize int
}
type SessionStore ¶
type SessionStore interface { ByID(id string) (*sessions.Session, error) ByPeer(peer uint64) (sessions.SessionList, error) All() (sessions.SessionList, error) Exists(id string) bool Upsert(sess *sessions.Session) error Delete(id string) error On(event string, handler func(*sessions.Session)) func() }
type SubscriptionStore ¶
type SubscriptionStore interface { ByTopic(tenant string, pattern []byte) (*subscriptions.SubscriptionList, error) ByID(id string) (*subscriptions.Subscription, error) All() (subscriptions.SubscriptionList, error) ByPeer(peer uint64) (subscriptions.SubscriptionList, error) BySession(id string) (subscriptions.SubscriptionList, error) Sessions() ([]string, error) Create(subscription *subscriptions.Subscription) error Delete(id string) error On(event string, handler func(*subscriptions.Subscription)) func() }
type TopicStore ¶
type TopicStore interface { Create(message *topics.RetainedMessage) error ByTopicPattern(tenant string, pattern []byte) (topics.RetainedMessageList, error) All() (topics.RetainedMessageList, error) On(event string, handler func(*topics.RetainedMessage)) func() }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.