storage

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: BSD-2-Clause Imports: 11 Imported by: 0

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
}

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 Storage

type Storage interface {
	// Task operations
	ReadTask(ctx context.Context, vaultPath string, taskID domain.TaskID) (*domain.Task, error)
	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)

	// Goal operations
	ReadGoal(ctx context.Context, vaultPath string, goalID domain.GoalID) (*domain.Goal, error)
	WriteGoal(ctx context.Context, goal *domain.Goal) error
	FindGoalByName(ctx context.Context, vaultPath string, name string) (*domain.Goal, error)

	// Theme operations
	ReadTheme(ctx context.Context, vaultPath string, themeID domain.ThemeID) (*domain.Theme, error)
	WriteTheme(ctx context.Context, theme *domain.Theme) error

	// Daily note operations
	ReadDailyNote(ctx context.Context, vaultPath string, date string) (string, error)
	WriteDailyNote(ctx context.Context, vaultPath string, date string, content string) error

	// Generic page operations
	ListPages(ctx context.Context, vaultPath string, pagesDir string) ([]*domain.Task, error)
}

func NewStorage

func NewStorage(storageConfig *Config) Storage

NewStorage creates a new markdown storage instance with custom configuration.

Jump to

Keyboard shortcuts

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