storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package storage

Copyright © 2026 mtnr_dev <timo@mtnr.cloud>

Package storage

Copyright © 2026 mtnr_dev <timo@mtnr.cloud>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONStore

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

JSONStore implements Store using a JSON file

func NewJSONStore

func NewJSONStore(customPath string) (*JSONStore, error)

NewJSONStore creates a new JSON file store If no path is provided, uses ~/.todo-cli/todos.json

func (*JSONStore) GetFilePath

func (js *JSONStore) GetFilePath() string

GetFilePath returns the path where todos are stored

func (*JSONStore) Load

func (js *JSONStore) Load() (*todo.TodoList, error)

Load reads the todo list from the JSON file

func (*JSONStore) Save

func (js *JSONStore) Save(list *todo.TodoList) error

Save writes the todo list to the JSON file

type Store

type Store interface {
	Load() (*todo.TodoList, error)
	Save(list *todo.TodoList) error
}

Store defines the interface for todo storage

Jump to

Keyboard shortcuts

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