Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PollInterval is the amount of time to wait between polling the database // for new stream events. PollInterval = time.Millisecond * 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileNotifier ¶
type FileNotifier interface { // Changes returns a channel if a file was created or deleted. Changes() (<-chan bool, error) }
FileNotifyWatcher represents a way to watch for changes in a namespace folder directory.
type Logger ¶
type Logger interface { Infof(message string, args ...interface{}) Debugf(message string, args ...interface{}) Tracef(message string, args ...interface{}) IsTraceEnabled() bool }
Logger represents the logging methods called.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream defines a worker that will poll the database for change events.
func New ¶
func New(db coredatabase.TrackedDB, fileNotifier FileNotifier, clock clock.Clock, logger Logger) *Stream
New creates a new Stream.
func (*Stream) Changes ¶
func (s *Stream) Changes() <-chan changestream.ChangeEvent
Changes returns a channel for a given namespace (database). The channel will return events represented by change log rows from the database. The change event IDs will be monotonically increasing (though not necessarily sequential). Events will be coalesced into a single change if they are for the same entity and edit type.
Click to show internal directories.
Click to hide internal directories.