config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthPath

func AuthPath() string

AuthPath returns the full path to auth.json.

func ConfigPath

func ConfigPath() string

ConfigPath returns the full path to config.json.

func Dir

func Dir() string

Dir returns the config directory path (~/.config/splitwise-cli).

func Save

func Save(cfg *Config) error

Save writes config to disk.

func Set

func Set(key, value string) error

Set updates a single config key.

Types

type Config

type Config struct {
	DefaultGroup    string `json:"default_group,omitempty"`
	DefaultCurrency string `json:"default_currency,omitempty"`
}

Config holds user preferences.

func Load

func Load() (*Config, error)

Load reads config from disk. Returns zero-value Config if file doesn't exist.

type UnknownKeyError

type UnknownKeyError struct {
	Key string
}

UnknownKeyError is returned when an unrecognized config key is used.

func (*UnknownKeyError) Error

func (e *UnknownKeyError) Error() string

Jump to

Keyboard shortcuts

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