cmd

package
v0.0.0-...-07734c6 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type Config

type Config struct {
	DisplayAsciiArt bool        `toml:"display_ascii_art"`
	Key             KeyConfig   `toml:"key"`
	Store           StoreConfig `toml:"store"`
	Git             GitConfig   `toml:"git"`
}

type DumpOptions

type DumpOptions struct {
	Encoding      string
	IncludeSecret bool
	Matchers      []glob.Glob
	GlobPatterns  []string
}

DumpOptions controls how a store is dumped to NDJSON.

type GitConfig

type GitConfig struct {
	AutoFetch  bool `toml:"auto_fetch"`
	AutoCommit bool `toml:"auto_commit"`
	AutoPush   bool `toml:"auto_push"`
}

type KeyConfig

type KeyConfig struct {
	AlwaysPromptDelete    bool `toml:"always_prompt_delete"`
	AlwaysPromptOverwrite bool `toml:"always_prompt_overwrite"`
}

type KeySpec

type KeySpec struct {
	Raw    string // Whole, unmodified user input
	RawKey string // Key segment
	RawDB  string // Store segment
	Key    string // Normalised Key
	DB     string // Normalised store
}

KeySpec is a parsed key reference.

func ParseKey

func ParseKey(raw string, defaults bool) (KeySpec, error)

ParseKey parses "KEY[@STORE]" into a normalized KeySpec. When defaults is true, a missing store defaults to the configured default.

func (KeySpec) Display

func (k KeySpec) Display() string

Display returns the normalized key reference but omits the default store if none was set manually

func (KeySpec) Full

func (k KeySpec) Full() string

Full returns the whole normalized key reference.

type ListArgs

type ListArgs struct {
	// contains filtered or unexported fields
}

ListArgs tracks the resolved flag configuration for the list command.

type Store

type Store struct{}

func (*Store) AllStores

func (s *Store) AllStores() ([]string, error)

func (*Store) FindStore

func (s *Store) FindStore(k string) (string, error)

func (*Store) FormatBytes

func (s *Store) FormatBytes(includeBinary bool, v []byte) string

func (*Store) Keys

func (s *Store) Keys(dbName string) ([]string, error)

Keys returns all keys for the provided store name (or default if empty). Keys are returned in lowercase to mirror stored key format.

func (*Store) Print

func (s *Store) Print(pf string, includeBinary bool, vs ...[]byte)

func (*Store) PrintTo

func (s *Store) PrintTo(w io.Writer, pf string, includeBinary bool, vs ...[]byte)

func (*Store) Transaction

func (s *Store) Transaction(args TransactionArgs) error

type StoreConfig

type StoreConfig struct {
	DefaultStoreName   string `toml:"default_store_name"`
	AlwaysPromptDelete bool   `toml:"always_prompt_delete"`
}

type TransactionArgs

type TransactionArgs struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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