Documentation
¶
Index ¶
Constants ¶
const Interval = 1
Interval represents the number of seconds to wait between to heartbeat rounds.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Query allows directly querying the API Query(string, string, interface{}, string) (*client.Response, string, error) // Websocket allows directly connection to API websockets Websocket(path string) (*websocket.Conn, error) }
Client represents a way to interact with the server API
type Cluster ¶
type Cluster interface { db.ClusterTransactioner }
Cluster mediates access to data stored in the cluster dqlite database.
type Endpoints ¶
type Endpoints interface { // NetworkAddress returns the network addresss of the network endpoint, or an // empty string if there's no network endpoint NetworkAddress() string // NetworkCert returns the full TLS certificate information for this endpoint. NetworkCert() *cert.Info }
Endpoints are in charge of bringing up and down the HTTP endpoints for serving the RESTful API.
type EventHook ¶
type EventHook func(int64, interface{})
EventHook is called when an event is dispatched
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events starts a task that continuously monitors the list of cluster nodes and maintains a pool of websocket connections against all of them, in order to get notified about events.
Whenever an event is received the given hook is invoked.
type EventsSource ¶
type EventsSource interface { // GetEvents connects to monitoring interface GetEvents() (*events.EventListener, error) }
EventsSource returns the raw messages from the server API
type EventsSourceProvider ¶
type EventsSourceProvider interface { // New creates a new events source for a given address Events(string, *cert.Info) (Client, EventsSource, error) }
EventsSourceProvider creates a new EventsSource
type Option ¶
type Option func(*options)
Option to be passed to Connect to customize the resulting instance.
func WithEventsSourceProvider ¶
func WithEventsSourceProvider(eventsSourceProvider EventsSourceProvider) Option
WithEventsSourceProvider sets the eventsSourceProvider on the option
func WithLogger ¶
WithLogger sets the logger on the option