Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // Run has the Controller execute all the Updaters passed on the channel, // until it's closed. The method runs synchronously and only returns after // the channel is closed or the context is canceled. // // Any spawned goroutines should inherit the passed-in Context. // // A call to Run should be thought of as one execution of the Updaters. // If a caller wants to call Run in a loop, it should use a new channel on // each iteration. Run(context.Context, <-chan driver.Updater) error }
Controller is the interface that updater Controllers implement.
type Offline ¶ added in v0.1.0
type Offline struct { // Output is used as the sink for calls to Run. // // A call to Run will write gzipped json objects to the Writer. // See the 'jsonblob' package for the details of the json format. // // This package does not take care of any framing for the writer. // If Run is called multiple times, this member should be reset accordingly. // That is, calling run multiple times with the same writer will result in // concatenated gzip blobs. Output io.Writer // If the Filter member is provided, the updater set's names will be passed // through it. Filter func(name string) (keep bool) }
Offline is a controller for running Updaters in an offline matter.
type Online ¶ added in v0.1.0
type Online struct { Pool *pgxpool.Pool Workers int // If the Filter member is provided, the updater set's names will be passed // through it. Filter func(name string) (keep bool) }
Online is a controller that writes updates to a database.
An Online should be constructed via a literal and is safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.