config

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package config provides persistent application configuration for PuzzleTea. Settings are stored as JSON in ~/.puzzletea/config.json alongside the game history database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns ~/.puzzletea/config.json.

Types

type Config

type Config struct {
	Theme string `json:"theme,omitempty"` // theme name; empty = default
}

Config holds all user-configurable settings.

func Default

func Default() *Config

Default returns a Config with all settings at their zero values (the built-in defaults).

func Load

func Load(path string) (*Config, error)

Load reads and parses a config file. If the file does not exist, a default Config is returned with no error. Parse errors are returned so callers can log a warning, but the application should still start with defaults.

func (*Config) Save

func (c *Config) Save(path string) error

Save writes the config to disk, creating the parent directory if needed.

Jump to

Keyboard shortcuts

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