Documentation
¶
Overview ¶
Package sqlite provides log state persistence backed by an sqlite database.
Index ¶
- type Opts
- 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 Opts ¶
type Opts struct {
// Path is the path the location of the underlying SQLite database file.
Path string
// MaxOpenConns sets to maximum number of open connections to the database.
MaxOpenConns int
}
Opts represents options for the sqlite persistence layer.
type Persistence ¶
type Persistence struct {
// contains filtered or unexported fields
}
Persistence is an implementation of witness.Persistence which knows how to use an sqlite database to safely store witness state.
func New ¶
New returns a persistence object that is backed by the provided database.
The returned shutdown func should be called once the persistence instance is no longer required.
Click to show internal directories.
Click to hide internal directories.