persistence

package
v0.0.0-...-b6deac6 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package persistence defines interfaces and tests for storing log state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogStatePersistence

type LogStatePersistence interface {
	// Init sets up the persistence layer. This should be idempotent,
	// and will be called once per process startup.
	Init(context.Context) error

	// Latest returns the latest checkpoint.
	// If no checkpoint exists, it must return nil.
	Latest(ctx context.Context, origin string) ([]byte, error)

	// Update allows for atomically updating the currently stored (if any)
	// checkpoint for the given origin.
	//
	// The provided function will be passed the currently stored checkpoint
	// for the provided log origin (or nil if no such checkpoint exists), and
	// should return the serialised form of the updated checkpoint, or an
	// error.
	Update(ctx context.Context, origin string, f func([]byte) ([]byte, error)) error
}

LogStatePersistence is a handle on persistent storage for log state.

Directories

Path Synopsis
Package inmemory provides a persistence implementation that lives only in memory.
Package inmemory provides a persistence implementation that lives only in memory.
Package sql provides log state persistence backed by a SQL database.
Package sql provides log state persistence backed by a SQL database.

Jump to

Keyboard shortcuts

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