storage

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID   string `bson:"_id"`
	Vaas []byte
}

Event represents a database change.

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher represents a listener of database changes.

func NewWatcher

func NewWatcher(db *mongo.Database, dbName string, handler WatcherFunc, logger *zap.Logger) *Watcher

NewWatcher creates a new database event watcher.

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context) error

Start executes database event consumption.

type WatcherFunc

type WatcherFunc func(*Event)

WatcherFunc is a function to send database changes.

Jump to

Keyboard shortcuts

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