changestreampruner

package
v0.0.0-...-56cb166 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs the changestream worker, using the resource names defined in the supplied config.

func NewWorker

func NewWorker(cfg WorkerConfig) (worker.Worker, error)

Types

type DBGetter

type DBGetter = coredatabase.DBGetter

DBGetter describes the ability to supply a sql.DB reference for a particular database.

type ManifoldConfig

type ManifoldConfig struct {
	DBAccessor string

	Clock     clock.Clock
	Logger    logger.Logger
	NewWorker NewWorkerFn
}

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

func (ManifoldConfig) Validate

func (cfg ManifoldConfig) Validate() error

type ModelNamespace

type ModelNamespace struct {
	UUID      string `db:"uuid"`
	Namespace string `db:"namespace"`
}

ModelNamespace represents a model and the associated DQlite namespace that it uses.

type NewWorkerFn

type NewWorkerFn = func(WorkerConfig) (worker.Worker, error)

NewWorkerFn is an alias function that allows the creation of EventQueueWorker.

type Pruner

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

Pruner defines a worker that will truncate the change log.

func (*Pruner) Kill

func (w *Pruner) Kill()

Kill is part of the worker.Worker interface.

func (*Pruner) Wait

func (w *Pruner) Wait() error

Wait is part of the worker.Worker interface.

type Watermark

type Watermark struct {
	ControllerID string    `db:"controller_id"`
	LowerBound   int64     `db:"lower_bound"`
	UpdatedAt    time.Time `db:"updated_at"`
}

Watermark represents a row from the change_log_witness table.

type WorkerConfig

type WorkerConfig struct {
	DBGetter DBGetter
	Clock    clock.Clock
	Logger   logger.Logger
}

WorkerConfig encapsulates the configuration options for the changestream worker.

func (*WorkerConfig) Validate

func (c *WorkerConfig) Validate() error

Validate ensures that the config values are valid.

Jump to

Keyboard shortcuts

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