broker

package
v0.0.0-...-354bb4a Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PatternSeparator   = "."
	SingleTokenMatcher = "*"
	MultiTokenMatcher  = ">"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

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

func NewBroker

func NewBroker() *Broker

func (*Broker) Broadcast

func (broker *Broker) Broadcast(event events.PubEvent) error

func (*Broker) Connect

func (broker *Broker) Connect(clientId string, client *ConnectedClient)

func (*Broker) Disconnect

func (broker *Broker) Disconnect(client *ConnectedClient)

type ConnectedClient

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

func NewConnectedClient

func NewConnectedClient(conn GenericConnection, id string) *ConnectedClient

func NewUnidentifiedClient

func NewUnidentifiedClient(conn GenericConnection) *ConnectedClient

func (*ConnectedClient) GetEligibility

func (client *ConnectedClient) GetEligibility(topic string) *Subscription

func (*ConnectedClient) GetId

func (client *ConnectedClient) GetId() string

func (*ConnectedClient) IsIdentified

func (client *ConnectedClient) IsIdentified() bool

func (*ConnectedClient) SetId

func (client *ConnectedClient) SetId(id string)

func (*ConnectedClient) SubscribeToPattern

func (client *ConnectedClient) SubscribeToPattern(pattern string, group string)

func (*ConnectedClient) UnsubscribeFromPattern

func (client *ConnectedClient) UnsubscribeFromPattern(pattern string)

func (*ConnectedClient) WriteDataMessage

func (client *ConnectedClient) WriteDataMessage(data []byte) error

func (*ConnectedClient) WriteInterface

func (client *ConnectedClient) WriteInterface(v any) error

type GenericConnection

type GenericConnection interface {
	WriteMessage(data []byte) error
}

type Subscription

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

func (*Subscription) GetGroup

func (s *Subscription) GetGroup() string

func (*Subscription) GetPattern

func (s *Subscription) GetPattern() string

func (*Subscription) IsActive

func (s *Subscription) IsActive() bool

func (*Subscription) Matches

func (s *Subscription) Matches(topic string) bool

Jump to

Keyboard shortcuts

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