storage

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: BSD-2-Clause Imports: 16 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TasksDir      string
	GoalsDir      string
	ThemesDir     string
	ObjectivesDir string
	VisionDir     string
	DailyDir      string
	Excludes      []string
}

Config holds the configuration for storage paths.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default storage configuration.

func NewConfigFromVault

func NewConfigFromVault(vault *config.Vault) *Config

NewConfigFromVault creates a Config from a Vault.

type DailyNoteStorage added in v0.25.3

type DailyNoteStorage interface {
	ReadDailyNote(ctx context.Context, vaultPath string, date string) (string, error)
	WriteDailyNote(ctx context.Context, vaultPath string, date string, content string) error
}

func NewDailyNoteStorage added in v0.25.3

func NewDailyNoteStorage(storageConfig *Config) DailyNoteStorage

NewDailyNoteStorage creates a storage for daily note operations only.

type DecisionStorage added in v0.25.3

type DecisionStorage interface {
	ListDecisions(ctx context.Context, vaultPath string) ([]*domain.Decision, error)
	FindDecisionByName(ctx context.Context, vaultPath string, name string) (*domain.Decision, error)
	WriteDecision(ctx context.Context, decision *domain.Decision) error
}

func NewDecisionStorage added in v0.25.3

func NewDecisionStorage(storageConfig *Config) DecisionStorage

NewDecisionStorage creates a storage for decision operations only.

type GoalStorage added in v0.25.3

type GoalStorage interface {
	WriteGoal(ctx context.Context, goal *domain.Goal) error
	FindGoalByName(ctx context.Context, vaultPath string, name string) (*domain.Goal, error)
}

func NewGoalStorage added in v0.25.3

func NewGoalStorage(storageConfig *Config) GoalStorage

NewGoalStorage creates a storage for goal operations only.

type ObjectiveStorage added in v0.29.0

type ObjectiveStorage interface {
	WriteObjective(ctx context.Context, objective *domain.Objective) error
	FindObjectiveByName(
		ctx context.Context,
		vaultPath string,
		name string,
	) (*domain.Objective, error)
}

func NewObjectiveStorage added in v0.29.0

func NewObjectiveStorage(storageConfig *Config) ObjectiveStorage

NewObjectiveStorage creates a storage for objective operations only.

type PageStorage added in v0.25.3

type PageStorage interface {
	ListPages(ctx context.Context, vaultPath string, pagesDir string) ([]*domain.Task, error)
}

func NewPageStorage added in v0.25.3

func NewPageStorage(storageConfig *Config) PageStorage

NewPageStorage creates a storage for page operations only.

type Storage

type Storage interface {
	TaskStorage
	GoalStorage
	ThemeStorage
	ObjectiveStorage
	VisionStorage
	DailyNoteStorage
	PageStorage
	DecisionStorage
	// Legacy methods — used by storage tests, not by ops.
	// Keep on composed interface for backward compat; not on narrow interfaces.
	ReadTask(ctx context.Context, vaultPath string, taskID domain.TaskID) (*domain.Task, error)
	ListTasks(ctx context.Context, vaultPath string) ([]*domain.Task, error)
	ReadGoal(ctx context.Context, vaultPath string, goalID domain.GoalID) (*domain.Goal, error)
	ReadTheme(ctx context.Context, vaultPath string, themeID domain.ThemeID) (*domain.Theme, error)
	ReadObjective(
		ctx context.Context,
		vaultPath string,
		objectiveID domain.ObjectiveID,
	) (*domain.Objective, error)
	ReadVision(
		ctx context.Context,
		vaultPath string,
		visionID domain.VisionID,
	) (*domain.Vision, error)
}

func NewStorage

func NewStorage(storageConfig *Config) Storage

NewStorage creates a new markdown storage instance with custom configuration.

type TaskStorage added in v0.25.3

type TaskStorage interface {
	WriteTask(ctx context.Context, task *domain.Task) error
	FindTaskByName(ctx context.Context, vaultPath string, name string) (*domain.Task, error)
	ListTasks(ctx context.Context, vaultPath string) ([]*domain.Task, error)
}

func NewTaskStorage added in v0.25.3

func NewTaskStorage(storageConfig *Config) TaskStorage

NewTaskStorage creates a storage for task operations only.

type ThemeStorage added in v0.29.0

type ThemeStorage interface {
	WriteTheme(ctx context.Context, theme *domain.Theme) error
	FindThemeByName(ctx context.Context, vaultPath string, name string) (*domain.Theme, error)
}

func NewThemeStorage added in v0.29.0

func NewThemeStorage(storageConfig *Config) ThemeStorage

NewThemeStorage creates a storage for theme operations only.

type VisionStorage added in v0.29.0

type VisionStorage interface {
	WriteVision(ctx context.Context, vision *domain.Vision) error
	FindVisionByName(ctx context.Context, vaultPath string, name string) (*domain.Vision, error)
}

func NewVisionStorage added in v0.29.0

func NewVisionStorage(storageConfig *Config) VisionStorage

NewVisionStorage creates a storage for vision operations only.

Jump to

Keyboard shortcuts

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