store

package
v2.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

View Source
const ServerName = "store"
View Source
const SnapshotFileName = "_snapshot"

Variables

View Source
var (
	FlagAppDBBackend = prefix("app-db-backend")
	FlagKeepRecent   = prefix("keep-recent")
	FlagInterval     = prefix("interval")
)

Functions

func UnmarshalConfig

func UnmarshalConfig(cfg map[string]any) (*root.Config, error)

UnmarshalConfig unmarshals the store config from the given map. If the config is not found in the map, the default config is returned. If the home directory is found in the map, it sets the home directory in the config. An empty home directory *is* permitted at this stage, but attempting to build the store with an empty home directory will fail.

Types

type Server

type Server[T transaction.Tx] struct {
	// contains filtered or unexported fields
}

Server manages store config and contains prune & snapshot commands

func New

func New[T transaction.Tx](store storev2.Backend, cfg server.ConfigMap) (*Server[T], error)

func (*Server[T]) CLICommands

func (s *Server[T]) CLICommands() serverv2.CLIConfig

func (*Server[T]) Config

func (s *Server[T]) Config() any

func (*Server[T]) DeleteSnapshotCmd

func (s *Server[T]) DeleteSnapshotCmd() *cobra.Command

DeleteSnapshotCmd returns the command to delete a local snapshot

func (*Server[T]) DumpArchiveCmd

func (s *Server[T]) DumpArchiveCmd() *cobra.Command

DumpArchiveCmd returns a command to dump the snapshot as portable archive format

func (*Server[T]) ExportSnapshotCmd

func (s *Server[T]) ExportSnapshotCmd() *cobra.Command

ExportSnapshotCmd exports app state to snapshot store.

func (*Server[T]) ListSnapshotsCmd

func (s *Server[T]) ListSnapshotsCmd() *cobra.Command

ListSnapshotsCmd returns the command to list local snapshots

func (*Server[T]) LoadArchiveCmd

func (s *Server[T]) LoadArchiveCmd() *cobra.Command

LoadArchiveCmd load a portable archive format snapshot into snapshot store

func (*Server[T]) Name

func (s *Server[T]) Name() string

func (*Server[T]) PrunesCmd

func (s *Server[T]) PrunesCmd() *cobra.Command

PrunesCmd implements the default command for pruning app history states.

func (*Server[T]) RestoreSnapshotCmd

func (s *Server[T]) RestoreSnapshotCmd() *cobra.Command

RestoreSnapshotCmd returns a command to restore a snapshot

func (*Server[T]) Start

func (s *Server[T]) Start(context.Context) error

func (*Server[T]) Stop

func (s *Server[T]) Stop(context.Context) error

Jump to

Keyboard shortcuts

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