Documentation ¶
Index ¶
- Constants
- type Broker
- func (b *Broker) Authenticate(transport transport.Metadata, sessionID []byte, username string, ...) (tenant string, id string, err error)
- func (b *Broker) CloseSession(id string) error
- func (b *Broker) DistributeMessage(message *rpc.MessagePublished) error
- func (b *Broker) Join(hosts []string)
- func (b *Broker) ListRetainedMessages() (topics.RetainedMessageSet, error)
- func (b *Broker) ListSessions() (sessions.SessionSet, error)
- func (b *Broker) ListSubscriptions() (subscriptions.SubscriptionSet, error)
- func (b *Broker) NotifyJoin(n *memberlist.Node)
- func (b *Broker) NotifyLeave(n *memberlist.Node)
- func (b *Broker) NotifyUpdate(n *memberlist.Node)
- func (b *Broker) OnConnect(transportSession *listener.Session) (int32, error)
- func (b *Broker) OnPublish(sess sessions.Session, p *packet.Publish) error
- func (b *Broker) OnSessionClosed(sess sessions.Session)
- func (b *Broker) OnSessionLost(sess sessions.Session)
- func (b *Broker) OnSubscribe(transportSession *listener.Session, sess sessions.Session, p *packet.Subscribe) error
- func (b *Broker) OnUnsubscribe(sess sessions.Session, packet *packet.Unsubscribe) error
- func (b *Broker) RemoteRPCProvider(addr, session string) sessions.Transport
- func (b *Broker) RetainThenDispatchToLocalSessions(tenant string, topic []byte, payload []byte, qos int32)
- func (b *Broker) Stop()
- type Config
- type Job
- type JobWrap
- type PeerStore
- type Pool
- type RemoteRPCTransport
- type STANMessage
- type SessionConfig
- type SessionStore
- type SubscriptionStore
- type TopicStore
Constants ¶
View Source
const ( EVENT_MESSAGE_PUBLISHED = "message_published" EVENT_STATE_UPDATED = "state_updated" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct { ID string Subscriptions SubscriptionStore Sessions SessionStore Topics TopicStore Peers PeerStore STANOutput chan STANMessage Listener io.Closer TCPTransport io.Closer TLSTransport io.Closer WSSTransport io.Closer WSTransport io.Closer RPC net.Listener RPCCaller *rpc.Caller // contains filtered or unexported fields }
func (*Broker) Authenticate ¶
func (*Broker) CloseSession ¶ added in v0.0.32
func (*Broker) DistributeMessage ¶ added in v0.0.37
func (b *Broker) DistributeMessage(message *rpc.MessagePublished) error
func (*Broker) ListRetainedMessages ¶
func (b *Broker) ListRetainedMessages() (topics.RetainedMessageSet, error)
func (*Broker) ListSessions ¶
func (b *Broker) ListSessions() (sessions.SessionSet, error)
func (*Broker) ListSubscriptions ¶
func (b *Broker) ListSubscriptions() (subscriptions.SubscriptionSet, error)
func (*Broker) NotifyJoin ¶ added in v0.0.37
func (b *Broker) NotifyJoin(n *memberlist.Node)
NotifyJoin is called if a peer joins the cluster.
func (*Broker) NotifyLeave ¶ added in v0.0.37
func (b *Broker) NotifyLeave(n *memberlist.Node)
NotifyLeave is called if a peer leaves the cluster.
func (*Broker) NotifyUpdate ¶ added in v0.0.37
func (b *Broker) NotifyUpdate(n *memberlist.Node)
NotifyUpdate is called if a cluster peer gets updated.
func (*Broker) OnSessionClosed ¶
func (*Broker) OnSessionLost ¶
func (*Broker) OnSubscribe ¶
func (*Broker) OnUnsubscribe ¶
func (*Broker) RemoteRPCProvider ¶ added in v0.0.42
func (*Broker) RetainThenDispatchToLocalSessions ¶ added in v0.0.18
type Config ¶
type Config struct { TCPPort int TLS *tls.Config TLSPort int WSSPort int WSPort int RPCPort int RPCIdentity identity.Identity GossipPort int NATSURL string AuthHelper func(transport transport.Metadata, sessionID []byte, username string, password string) (tenant string, err error) Session SessionConfig }
func DefaultConfig ¶
func DefaultConfig() Config
type RemoteRPCTransport ¶ added in v0.0.42
type RemoteRPCTransport struct {
// contains filtered or unexported fields
}
func (*RemoteRPCTransport) Close ¶ added in v0.0.42
func (r *RemoteRPCTransport) Close() error
type STANMessage ¶ added in v0.0.30
type SessionConfig ¶ added in v0.0.9
type SessionConfig struct {
MaxInflightSize int
}
type SessionStore ¶
type SessionStore interface { ByID(id string) (sessions.Session, error) ByClientID(id string) (sessions.SessionSet, error) ByPeer(peer string) (sessions.SessionSet, error) All() (sessions.SessionSet, error) Exists(id string) bool Upsert(sess sessions.Session, transport sessions.Transport) error Delete(id, reason string) error On(event string, handler func(sessions.Session)) func() }
type SubscriptionStore ¶
type SubscriptionStore interface { ByTopic(tenant string, pattern []byte) (subscriptions.SubscriptionSet, error) ByID(id string) (subscriptions.Subscription, error) All() (subscriptions.SubscriptionSet, error) ByPeer(peer string) (subscriptions.SubscriptionSet, error) BySession(id string) (subscriptions.SubscriptionSet, error) Sessions() ([]string, error) Create(message subscriptions.Subscription, sender func(packet.Publish) error) 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.RetainedMessageSet, error) All() (topics.RetainedMessageSet, error) On(event string, handler func(topics.RetainedMessage)) func() }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.