store

package
v2.0.0-...-52ba264 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

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

This section is empty.

Types

type Config

type Config struct {
	AppDBBackend string       `mapstructure:"app-db-backend" toml:"app-db-backend" comment:"The type of database for application and snapshots databases."`
	Options      root.Options `mapstructure:"options" toml:"options"`
}

func DefaultConfig

func DefaultConfig() *Config

type StoreComponent

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

StoreComponent manages store config and contains prune & snapshot commands

func New

func New[T transaction.Tx](appCreator serverv2.AppCreator[T]) *StoreComponent[T]

func (*StoreComponent[T]) CLICommands

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

func (*StoreComponent[T]) Config

func (g *StoreComponent[T]) Config() any

func (*StoreComponent[T]) DeleteSnapshotCmd

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

DeleteSnapshotCmd returns the command to delete a local snapshot

func (*StoreComponent[T]) DumpArchiveCmd

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

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

func (*StoreComponent[T]) ExportSnapshotCmd

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

QueryBlockResultsCmd implements the default command for a BlockResults query.

func (*StoreComponent[T]) Init

func (s *StoreComponent[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logger log.Logger) error

func (*StoreComponent[T]) ListSnapshotsCmd

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

ListSnapshotsCmd returns the command to list local snapshots

func (*StoreComponent[T]) LoadArchiveCmd

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

LoadArchiveCmd load a portable archive format snapshot into snapshot store

func (*StoreComponent[T]) Name

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

func (*StoreComponent[T]) PrunesCmd

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

QueryBlockResultsCmd implements the default command for a BlockResults query.

func (*StoreComponent[T]) RestoreSnapshotCmd

func (s *StoreComponent[T]) RestoreSnapshotCmd(newApp serverv2.AppCreator[T]) *cobra.Command

RestoreSnapshotCmd returns a command to restore a snapshot

func (*StoreComponent[T]) Start

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

func (*StoreComponent[T]) Stop

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

Jump to

Keyboard shortcuts

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