config

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AppName = "ponto"

AppName is the application name used for config directories.

Variables

This section is empty.

Functions

func ConfigExists

func ConfigExists() (bool, error)

ConfigExists checks if the config file exists.

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the config file path.

func Dir

func Dir() (string, error)

Dir returns the config directory path.

func EnsureDir

func EnsureDir() (string, error)

EnsureDir creates the config directory if it doesn't exist.

func EnsureKeyringDir

func EnsureKeyringDir() (string, error)

EnsureKeyringDir creates the keyring directory if it doesn't exist.

func KeyringDir

func KeyringDir() (string, error)

KeyringDir returns the keyring directory path.

func WriteConfig

func WriteConfig(cfg File) error

WriteConfig writes the config file atomically.

Types

type File

type File struct {
	DefaultProfile string             `yaml:"default_profile,omitempty"`
	Profiles       map[string]Profile `yaml:"profiles,omitempty"`
	KeyringBackend string             `yaml:"keyring_backend,omitempty"`
}

File represents the config file structure.

func ReadConfig

func ReadConfig() (File, error)

ReadConfig reads the config file.

type Profile

type Profile struct {
	// Credentials are stored in keyring, not here
	AccountID string `yaml:"account_id,omitempty"`
}

Profile represents a named profile configuration.

Jump to

Keyboard shortcuts

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