spanner

package
v0.0.0-...-4cdf746 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 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

Spanner is an implementation of the witness persistence interface which relies on Google Cloud Spanner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persistence

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

Persistence is a witness.Persistence implementation which knows how to use Spanner to safely store witness state.

func New

func New(ctx context.Context, spannerURI string) (*Persistence, func() error, error)

New returns a persistence object that is backed by the Spanner database.

func (*Persistence) AddLogs

func (p *Persistence) AddLogs(ctx context.Context, lc []config.Log) error

AddLogs adds the provided log configs to the database.

func (*Persistence) Init

func (p *Persistence) Init(ctx context.Context) error

Init initialises the persistence layer.

func (*Persistence) Latest

func (p *Persistence) Latest(ctx context.Context, origin string) ([]byte, error)

Latest returns the latest checkpoint for the given log, if it exists, and nil otherwise.

func (*Persistence) Log

func (p *Persistence) Log(ctx context.Context, origin string) (config.Log, bool, error)

Log returns the configuration info for the provided log, if it exists. Returns the config and true if found, false and no error if not found. An error is returned only if there was an error while attempting to read from the storage.

func (*Persistence) Logs

Logs returns an iterator over the set of known and enabled log configs. Disabled logs will be skipped. An error is returned only if there was an error while attempting to read from the storage.

func (*Persistence) Update

func (p *Persistence) Update(ctx context.Context, origin string, f func([]byte) ([]byte, error)) error

Update attempts to atomically update the latest checkpoint for the given log.

Jump to

Keyboard shortcuts

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