Documentation ¶
Index ¶
- type Client
- func (c *Client) GetAccessToken() string
- func (c *Client) PageDelete(ctx context.Context, since time.Time, cb func(evt *Event)) error
- func (c *Client) PageUpdate(ctx context.Context, since time.Time, cb func(evt *Event)) error
- func (c *Client) PageVisibility(ctx context.Context, since time.Time, cb func(evt *Event)) error
- func (c *Client) SetAccessToken(accessToken string)
- type Connection
- type ConnectionManger
- type Event
- type EventID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string HTTPClient *http.Client // contains filtered or unexported fields }
Client firehose streaming client to simplify work with WME realtime API.
func (*Client) GetAccessToken ¶
GetAccessToken returns value of the access token.
func (*Client) PageDelete ¶
PageDelete opens connection to page delete stream.
func (*Client) PageUpdate ¶
PageUpdate opens connection to page update stream.
func (*Client) PageVisibility ¶
PageVisibility opens connection to page visibility stream.
func (*Client) SetAccessToken ¶
SetAccessToken sets access token for authentication.
type Connection ¶
type Connection struct { Since time.Time Stream func(ctx context.Context, since time.Time, cb func(evt *Event)) error Handler func(evt *Event) }
Connection creates a single connection to the firehose stream.
type ConnectionManger ¶
type ConnectionManger struct {
// contains filtered or unexported fields
}
ConnectionManager helps keep connections open for firehose (realtime), satisfies "alt least once" delivery for the event.
func NewConnectionManger ¶
func NewConnectionManger() *ConnectionManger
NewConnectionManager creates a connection manager with an empty connections list.
func (*ConnectionManger) Add ¶
func (cm *ConnectionManger) Add(con *Connection)
Add appends new connection to the list of connections.
func (*ConnectionManger) Connect ¶
func (cm *ConnectionManger) Connect(ctx context.Context, errs chan error)
Connect opens connections for the list in a blocking call. Leaves concurrency to the caller. Pushes connection errors to the provided channel. If you don't want error deliveries just pass nil instead of the channel.