Add 'snapshots' command.

This commit is contained in:
Ben Johnson
2020-12-30 15:31:12 -07:00
parent 5cc78fafa0
commit ffc25e2654
5 changed files with 207 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ import (
"regexp"
"strconv"
"strings"
"time"
_ "github.com/mattn/go-sqlite3"
)
@@ -40,6 +41,15 @@ var (
ErrNoSnapshots = errors.New("no snapshots available")
)
// SnapshotInfo represents file information about a snapshot.
type SnapshotInfo struct {
Name string
Replica string
Generation string
Index int
CreatedAt time.Time
}
// Pos is a position in the WAL for a generation.
type Pos struct {
Generation string // generation name