Documentation ¶
Index ¶
- Variables
- func ContainsWildcard(topic string) bool
- func InitLogger(infoHandle, errorHandle io.Writer)
- func ValidateTopicFilter(topic string) ([]string, error)
- func ValidateTopicName(topic string) ([]string, error)
- type AGateway
- type Client
- func (c *Client) AddPendingMessage(p *P.PublishMessage)
- func (c *Client) AddrString() string
- func (c *Client) FetchPendingMessage(topicId uint16) *P.PublishMessage
- func (c *Client) Register(topicId uint16, topic string)
- func (c *Client) Registered(topicId uint16) bool
- func (c *Client) String() string
- func (c *Client) Write(m P.Message) error
- type Clients
- type Gateway
- type GatewayConfig
- type SNClient
- type TClient
- type TGateway
- type TopicTree
Constants ¶
This section is empty.
Variables ¶
View Source
var ( /* Config Errors */ ErrMissingValueForConfigOption = errors.New("Missing value for config option") ErrTooManyValuesForConfigOption = errors.New("Too many values for config option") ErrUnknownConfigOption = errors.New("Unknown config option") ErrNoTransportSpecified = errors.New("Missing transport") ErrInvalidModeSpecified = errors.New("Invalid mode") ErrNotANumber = errors.New("Not a number") /* Protocol Errors */ ErrZeroLengthClientID = errors.New("Zero-length clientID is invalid") ErrClientIDTooLong = errors.New("ClientID too long") /* Topic Errors */ ErrTopicFilterEmptyString = errors.New("TopicFilter cannot be empty string") ErrTopicFilterInvalidWildcard = errors.New("TopicFilter contains invalid wildcard") ErrTopicNameEmptyString = errors.New("TopicName cannot be empty string") ErrTopicNameContainsWildcard = errors.New("TopicName cannot contain wildcard") /* Topic Tree Errors */ ErrNoSuchSubscriptionExists = errors.New("Subscription does not exist") ErrNoSubscribers = errors.New("No subscribers") ErrClientNotSubscribed = errors.New("Client not subscribed") )
Functions ¶
Types ¶
type AGateway ¶
type AGateway struct {
// contains filtered or unexported fields
}
func NewAGateway ¶
func NewAGateway(gc *GatewayConfig, stopsig chan os.Signal) *AGateway
func (*AGateway) OnPacket ¶
type Client ¶
type Client struct { sync.RWMutex ClientId string Conn *net.UDPConn Address *net.UDPAddr // contains filtered or unexported fields }
func (*Client) AddPendingMessage ¶
func (c *Client) AddPendingMessage(p *P.PublishMessage)
func (*Client) FetchPendingMessage ¶
func (c *Client) FetchPendingMessage(topicId uint16) *P.PublishMessage
type Clients ¶
func (*Clients) AddClient ¶
Return true if this is a new client, false otherwise Clients are indexed by their address:port b/c that's the only indentifying information we have outside of a CONNECT packet
type Gateway ¶
type GatewayConfig ¶
type GatewayConfig struct {
// contains filtered or unexported fields
}
func ParseConfigFile ¶
func ParseConfigFile(file string) (*GatewayConfig, error)
func (*GatewayConfig) IsAggregating ¶
func (gc *GatewayConfig) IsAggregating() bool
type TGateway ¶
type TGateway struct {
// contains filtered or unexported fields
}
func NewTGateway ¶
func NewTGateway(gc *GatewayConfig, stopsig chan os.Signal) *TGateway
func (*TGateway) OnPacket ¶
type TopicTree ¶
func (*TopicTree) AddSubscription ¶
return false if there is already a subscriber of this topic, true if this is the first subscriber
func (*TopicTree) RemoveSubscription ¶
topic could contain wild cards, however we do only consider the literal topic string - (wilds are not evaluated for this)
Click to show internal directories.
Click to hide internal directories.