Help us shape the future of Go! Take the 2026 Go Developer Survey

state

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystem

type FileSystem interface {
	UserHomeDir() (string, error)
	ReadFile(path string) ([]byte, error)
	WriteFile(path string, data []byte, perm os.FileMode) error
	MkdirAll(path string, perm os.FileMode) error
}

FileSystem abstracts file operations for testability.

type Manager

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

Manager handles state loading and saving with injected dependencies.

func NewManager

func NewManager(fs FileSystem) *Manager

NewManager creates a new Manager with the provided filesystem.

func (*Manager) Load

func (m *Manager) Load() (*domain.State, error)

Load reads application state from disk using the injected filesystem.

func (*Manager) Save

func (m *Manager) Save(s *domain.State) error

Save writes application state to disk using the injected filesystem.

Jump to

Keyboard shortcuts

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