config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoHomeDir = fmt.Errorf("cannot determine home directory: HOME environment variable not set")

ErrNoHomeDir is returned when the home directory cannot be determined

Functions

func ConfigPath

func ConfigPath() (string, error)

func ExpandPath

func ExpandPath(path string) (string, error)

ExpandPath expands ~ to home directory. Returns error if path starts with ~ but home directory cannot be determined.

Types

type Config

type Config struct {
	SourceDir string   `yaml:"source_dir"`
	BackupDir string   `yaml:"backup_dir"`
	Schedule  string   `yaml:"schedule"`
	Time      string   `yaml:"time"`
	Exclude   []string `yaml:"exclude"`
	Retention struct {
		KeepLast int `yaml:"keep_last"`
	} `yaml:"retention"`
}

func DefaultConfig

func DefaultConfig() (*Config, error)

func Load

func Load() (*Config, error)

func (*Config) Save

func (c *Config) Save() error

Jump to

Keyboard shortcuts

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