Documentation ¶
Index ¶
- type Client
- func (c *Client) AddSub(sub event.Subscribe)
- func (c *Client) Close() error
- func (c *Client) GetAllSubs() (res []event.Subscribe)
- func (c *Client) Private(key, sec, url string, dms int) (*Client, error)
- func (c *Client) Public(url string) (*Client, error)
- func (c *Client) Read(ch chan<- msg.Msg)
- func (c *Client) RemoveSub(sub event.Subscribe)
- func (c *Client) Send(pld interface{}) error
- func (c *Client) SubAdded(sub event.Subscribe) (isAdded bool)
- func (c *Client) SubsLimitReached() bool
- func (c *Client) Subscribe(sub event.Subscribe) error
- func (c *Client) Unsubscribe(chanID int64) error
- func (c *Client) WithID(ID int) *Client
- func (c *Client) WithSubsLimit(limit int) *Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetAllSubs ¶
GetAllSubs returns all subscriptions
func (*Client) SubAdded ¶
SubAdded checks if given subscription is already added. Used to avoid duplicate subscriptions per client
func (*Client) SubsLimitReached ¶
SubsLimitReached returns true if number of subs > subsLimit
func (*Client) Subscribe ¶
Subscribe takes subscription payload as per docs and subscribes client to it. We keep track of subscriptions so that when client failes, we can resubscribe.
func (*Client) Unsubscribe ¶
Unsubscribe takes channel id and unsubscribes client from it.
func (*Client) WithSubsLimit ¶
WithSubsLimit sets limit of subscriptions on the instance
Click to show internal directories.
Click to hide internal directories.