Documentation
¶
Overview ¶
Spanner is an implementation of the witness persistence interface which relies on Google Cloud Spanner.
Index ¶
- type Persistence
- func (p *Persistence) AddLogs(ctx context.Context, lc []config.Log) error
- func (p *Persistence) Init(ctx context.Context) error
- func (p *Persistence) Latest(ctx context.Context, origin string) ([]byte, error)
- func (p *Persistence) Log(ctx context.Context, origin string) (config.Log, bool, error)
- func (p *Persistence) Logs(ctx context.Context) iter.Seq2[config.Log, error]
- func (p *Persistence) Update(ctx context.Context, origin string, f func([]byte) ([]byte, error)) error
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 (*Persistence) Init ¶
func (p *Persistence) Init(ctx context.Context) error
Init initialises the persistence layer.
func (*Persistence) Latest ¶
Latest returns the latest checkpoint for the given log, if it exists, and nil otherwise.
func (*Persistence) Log ¶
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.
Click to show internal directories.
Click to hide internal directories.