httpclient

package
v1.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 8 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Client struct {
	*client.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

func New(url string, opts ...client.ClientOpt) (*Client, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL