Documentation
¶
Overview ¶
Package httpclient is a client of the broadcaster's HTTP API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a client of the broadcaster's HTTP API, which wraps the base HTTP client, with typed methods for its requests
func New ¶
New returns a client of the broadcaster's API, at the URL, which is the server's API endpoint, such as http://localhost:8084/api, with the options. Each method adds its own path, such as changes, as the broadcaster's handlers register them.
func (*Client) WatchChanges ¶
func (c *Client) WatchChanges(ctx context.Context, filter schema.ChangeFilter, fn func(schema.Change) error) error
WatchChanges calls the function with each of the broadcaster's changes which match the filter, which are all of them when it's empty, as the server streams them, such as when a row is created, updated or deleted, until the context is cancelled, when it returns nil, or the function returns an error, which it returns, or the stream ends. When the server stops, it returns ErrServiceUnavailable.