Documentation ¶
Index ¶
- Constants
- Variables
- func UnmarshalConfig(cfg map[string]any) (*root.Config, error)
- type Server
- func (s *Server[T]) CLICommands() serverv2.CLIConfig
- func (s *Server[T]) Config() any
- func (s *Server[T]) DeleteSnapshotCmd() *cobra.Command
- func (s *Server[T]) DumpArchiveCmd() *cobra.Command
- func (s *Server[T]) ExportSnapshotCmd() *cobra.Command
- func (s *Server[T]) ListSnapshotsCmd() *cobra.Command
- func (s *Server[T]) LoadArchiveCmd() *cobra.Command
- func (s *Server[T]) Name() string
- func (s *Server[T]) PrunesCmd() *cobra.Command
- func (s *Server[T]) RestoreSnapshotCmd() *cobra.Command
- func (s *Server[T]) Start(context.Context) error
- func (s *Server[T]) Stop(context.Context) error
Constants ¶
const ServerName = "store"
const SnapshotFileName = "_snapshot"
Variables ¶
var ( FlagAppDBBackend = prefix("app-db-backend") FlagKeepRecent = prefix("keep-recent") FlagInterval = prefix("interval") )
Functions ¶
func UnmarshalConfig ¶
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 (*Server[T]) CLICommands ¶
func (*Server[T]) DeleteSnapshotCmd ¶
DeleteSnapshotCmd returns the command to delete a local snapshot
func (*Server[T]) DumpArchiveCmd ¶
DumpArchiveCmd returns a command to dump the snapshot as portable archive format
func (*Server[T]) ExportSnapshotCmd ¶
ExportSnapshotCmd exports app state to snapshot store.
func (*Server[T]) ListSnapshotsCmd ¶
ListSnapshotsCmd returns the command to list local snapshots
func (*Server[T]) LoadArchiveCmd ¶
LoadArchiveCmd load a portable archive format snapshot into snapshot store
func (*Server[T]) PrunesCmd ¶
PrunesCmd implements the default command for pruning app history states.
func (*Server[T]) RestoreSnapshotCmd ¶
RestoreSnapshotCmd returns a command to restore a snapshot