keelpersistence

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 2 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package keelpersistence provides backend-agnostic persistence contracts shared by the keel storage integrations: the sentinel errors ErrNotFound and ErrDirtyWrite, and the DistributedRWLock interface.

Concrete implementations live in separate modules, such as github.com/foomo/keel/persistence/mongo and github.com/foomo/keel/persistence/postgres.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested entity does not exist.
	ErrNotFound = errors.New("not found error")
	// ErrDirtyWrite is returned when an optimistic, version-checked write
	// fails because the stored entity was modified concurrently.
	ErrDirtyWrite = errors.New("dirty write error")
)

Functions

This section is empty.

Types

type DistributedRWLock added in v0.30.0

type DistributedRWLock interface {
	AcquireShared(ctx context.Context, lockID string) (bool, error)
	AcquireExclusive(ctx context.Context, lockID string) (bool, error)
	Release(ctx context.Context, lockID string) error
}

DistributedRWLock coordinates shared and exclusive holders of a single cluster-wide resource. Any number of shared holders may hold the lock concurrently, while an exclusive holder excludes all others.

AcquireShared and AcquireExclusive return (true, nil) on success and (false, nil) when blocked by the other side; a non-nil error indicates a backend failure. Release frees the lock held under lockID.

See github.com/foomo/keel/persistence/mongo for a MongoDB implementation.

Directories

Path Synopsis
mongo module
postgres module

Jump to

Keyboard shortcuts

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