store

package
v0.0.0-...-1fd83c1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverName        = "sqlite"
	GooseDialect      = "sqlite3"
	ForeignKeysPragma = "PRAGMA foreign_keys = ON"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStore

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

func NewStoreFromDB

func NewStoreFromDB(db *bun.DB) *Store

func (*Store) Close

func (s *Store) Close() error

func (*Store) CountSlugsByPrefix

func (s *Store) CountSlugsByPrefix(ctx context.Context, prefix string) (int, error)

CountSlugsByPrefix returns the number of items whose slug matches prefix or prefix-<number>.

func (*Store) CreateContext

func (s *Store) CreateContext(ctx context.Context, name, description string) (*models.Context, error)

func (*Store) CreateItem

func (s *Store) CreateItem(ctx context.Context, item *models.Item) error

func (*Store) DeleteContext

func (s *Store) DeleteContext(ctx context.Context, name string) error

func (*Store) GetContext

func (s *Store) GetContext(ctx context.Context, name string) (*models.Context, error)

func (*Store) GetItem

func (s *Store) GetItem(ctx context.Context, identifier string) (*models.Item, error)

func (*Store) GetState

func (s *Store) GetState(ctx context.Context, name string) (*models.State, error)

GetState retrieves a state by name.

func (*Store) ListContexts

func (s *Store) ListContexts(ctx context.Context) ([]models.Context, error)

func (*Store) RenameContext

func (s *Store) RenameContext(ctx context.Context, oldName, newName string) (*models.Context, error)

Jump to

Keyboard shortcuts

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