store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: EUPL-1.2 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("store: not found")

ErrNotFound is returned when a key does not exist in the store.

Functions

This section is empty.

Types

type Store

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

Store is a group-namespaced key-value store backed by SQLite.

func New

func New(dbPath string) (*Store, error)

New creates a Store at the given SQLite path. Use ":memory:" for tests.

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying database.

func (*Store) Count

func (s *Store) Count(group string) (int, error)

Count returns the number of keys in a group.

func (*Store) Delete

func (s *Store) Delete(group, key string) error

Delete removes a single key from a group.

func (*Store) DeleteGroup

func (s *Store) DeleteGroup(group string) error

DeleteGroup removes all keys in a group.

func (*Store) Get

func (s *Store) Get(group, key string) (string, error)

Get retrieves a value by group and key.

func (*Store) GetAll

func (s *Store) GetAll(group string) (map[string]string, error)

GetAll returns all key-value pairs in a group.

func (*Store) Render

func (s *Store) Render(tmplStr, group string) (string, error)

Render loads all key-value pairs from a group and renders a Go template.

func (*Store) Set

func (s *Store) Set(group, key, value string) error

Set stores a value by group and key, overwriting if exists.

Jump to

Keyboard shortcuts

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