store

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoardStore

type BoardStore interface {
	Create(config *model.BoardConfig) error
	Get(boardName string) (*model.BoardConfig, error)
	Update(config *model.BoardConfig) error
	Delete(boardName string) error
	List() ([]string, error) // Returns board names
	Exists(boardName string) bool
}

BoardStore handles board persistence.

type CardStore

type CardStore interface {
	Create(boardName string, card *model.Card) error
	Get(boardName, cardID string) (*model.Card, error)
	Update(boardName string, card *model.Card) error
	Delete(boardName, cardID string) error
	List(boardName string) ([]*model.Card, error)
	FindByAlias(boardName, alias string) (*model.Card, error)
}

CardStore handles card persistence.

type FileBoardStore

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

FileBoardStore implements BoardStore using the filesystem.

func NewBoardStore

func NewBoardStore(paths *config.Paths) *FileBoardStore

NewBoardStore creates a new board store.

func (*FileBoardStore) Create

func (s *FileBoardStore) Create(cfg *model.BoardConfig) error

Create creates a new board with the given config.

func (*FileBoardStore) Delete added in v0.16.0

func (s *FileBoardStore) Delete(boardName string) error

Delete removes a board and all its data (config and cards).

func (*FileBoardStore) Exists

func (s *FileBoardStore) Exists(boardName string) bool

Exists returns true if the board exists.

func (*FileBoardStore) Get

func (s *FileBoardStore) Get(boardName string) (*model.BoardConfig, error)

Get reads the board config from disk.

func (*FileBoardStore) List

func (s *FileBoardStore) List() ([]string, error)

List returns the names of all boards.

func (*FileBoardStore) Update

func (s *FileBoardStore) Update(cfg *model.BoardConfig) error

Update writes the board config to disk. Note: We don't validate card_display on Update because: 1. The config may have been valid before stricter validation was added 2. Update is often just adding/removing card IDs, not changing card_display Validation happens on Create; invalid configs produce warnings at load time.

type FileCardStore

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

FileCardStore implements CardStore using the filesystem.

func NewCardStore

func NewCardStore(paths *config.Paths) *FileCardStore

NewCardStore creates a new card store.

func (*FileCardStore) Create

func (s *FileCardStore) Create(boardName string, card *model.Card) error

Create writes a new card to disk.

func (*FileCardStore) Delete

func (s *FileCardStore) Delete(boardName, cardID string) error

Delete removes a card from disk.

func (*FileCardStore) FindByAlias

func (s *FileCardStore) FindByAlias(boardName, alias string) (*model.Card, error)

FindByAlias searches for a card by alias.

func (*FileCardStore) Get

func (s *FileCardStore) Get(boardName, cardID string) (*model.Card, error)

Get reads a card from disk by ID.

func (*FileCardStore) List

func (s *FileCardStore) List(boardName string) ([]*model.Card, error)

List returns all cards for a board. Malformed card files are logged and skipped.

func (*FileCardStore) Update

func (s *FileCardStore) Update(boardName string, card *model.Card) error

Update writes an existing card to disk.

type FileGlobalStore

type FileGlobalStore struct{}

FileGlobalStore implements GlobalStore using the filesystem.

func NewGlobalStore

func NewGlobalStore() *FileGlobalStore

NewGlobalStore creates a new global store.

func (*FileGlobalStore) EnsureExists

func (s *FileGlobalStore) EnsureExists() error

EnsureExists creates the global config file if it doesn't exist.

func (*FileGlobalStore) Load

func (s *FileGlobalStore) Load() (*model.GlobalConfig, error)

Load reads the global config from disk. Returns an empty config if the file doesn't exist.

func (*FileGlobalStore) Save

func (s *FileGlobalStore) Save(cfg *model.GlobalConfig) error

Save writes the global config to disk.

type FileProjectStore added in v0.8.0

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

FileProjectStore implements ProjectStore using the filesystem.

func NewProjectStore added in v0.8.0

func NewProjectStore(paths *config.Paths) *FileProjectStore

NewProjectStore creates a new project store.

func (*FileProjectStore) EnsureInitialized added in v0.8.0

func (s *FileProjectStore) EnsureInitialized(defaultName string) error

EnsureInitialized ensures the project config exists and has an ID. If the config file doesn't exist, creates one with the given name. If the config exists but has no ID, generates one and saves. This provides a graceful upgrade path for projects created before project configs existed.

func (*FileProjectStore) Exists added in v0.8.0

func (s *FileProjectStore) Exists() bool

Exists returns true if the project config file exists.

func (*FileProjectStore) Load added in v0.8.0

func (s *FileProjectStore) Load() (*model.ProjectConfig, error)

Load reads the project config from disk. Returns a default config if the file doesn't exist.

func (*FileProjectStore) Save added in v0.8.0

func (s *FileProjectStore) Save(cfg *model.ProjectConfig) error

Save writes the project config to disk.

type GlobalStore

type GlobalStore interface {
	Load() (*model.GlobalConfig, error)
	Save(config *model.GlobalConfig) error
	EnsureExists() error
}

GlobalStore handles global config persistence.

type ProjectStore added in v0.8.0

type ProjectStore interface {
	Load() (*model.ProjectConfig, error)
	Save(config *model.ProjectConfig) error
	Exists() bool
	EnsureInitialized(defaultName string) error
}

ProjectStore handles project-level config persistence.

Jump to

Keyboard shortcuts

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