Source File
meta.go
Belonging Package
github.com/polarsignals/wal/types
// Copyright (c) HashiCorp, Inc// SPDX-License-Identifier: MPL-2.0package typesimport// MetaStore is the interface we need to some persistent, crash safe backend. We// implement it with BoltDB for real usage but the interface allows alternatives// to be used, or tests to mock out FS access.type MetaStore interface {// Load loads the existing persisted state. If there is no existing state// implementations are expected to create initialize new storage and return an// empty state.Load(dir string) (PersistentState, error)// CommitState must atomically replace all persisted metadata in the current// store with the set provided. It must not return until the data is persisted// durably and in a crash-safe way otherwise the guarantees of the WAL will be// compromised. The WAL will only ever call this in a single thread at one// time and it will never be called concurrently with Load however it may be// called concurrently with Get/SetStable operations.CommitState(PersistentState) errorio.Closer}// PersistentState represents the WAL file metadata we need to store reliably to// recover on restart.type PersistentState struct {NextSegmentID uint64Segments []SegmentInfo}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |