Documentation
¶
Index ¶
Constants ¶
View Source
const ( PUBLISH = "publish" SUBSCRIBE = "subscribe" UNSUBSCRIBE = "unsubscribe" )
View Source
const MAX_BUFFER = 1024
Variables ¶
View Source
var Topics = []string{}
Functions ¶
This section is empty.
Types ¶
type PubSubClient ¶
type PubSubClient struct {
ID string
// contains filtered or unexported fields
}
func NewPubSubClient ¶
func NewPubSubClient(socketPath string) (*PubSubClient, error)
func (*PubSubClient) Subscribe ¶
func (p *PubSubClient) Subscribe(topic string) (chan string, error)
func (*PubSubClient) Unsubscribe ¶
func (p *PubSubClient) Unsubscribe(topic string) error
type PubSubHandler ¶
type PubSubHandler struct {
Clients []Client
Subscriptions []Subscription
}
func Listener ¶
func Listener(socketPath string) *PubSubHandler
func (*PubSubHandler) GetClientSubscriptions ¶
func (ps *PubSubHandler) GetClientSubscriptions(client *Client) []Subscription
func (*PubSubHandler) GetTopicSubscriptions ¶
func (ps *PubSubHandler) GetTopicSubscriptions(topic string) []Subscription
func (*PubSubHandler) IsClientSubscribed ¶
func (ps *PubSubHandler) IsClientSubscribed(topic string, client *Client) bool
type Subscription ¶
Click to show internal directories.
Click to hide internal directories.