config

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config persists aiacc providers and accounts as TOML.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

DefaultPath returns the config file location, honoring XDG_CONFIG_HOME.

func Save

func Save(path string, c *Config) error

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

Types

type Account

type Account struct {
	Dir   string `toml:"dir"`
	Quota int    `toml:"quota,omitempty"`
}

type Config

type Config struct {
	Providers map[string]Provider `toml:"providers"`
}

func Load

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

Load reads the config; a missing file yields an empty, ready-to-use Config.

type Provider

type Provider struct {
	EnvVar   string             `toml:"env_var"`
	Command  string             `toml:"command,omitempty"`
	Accounts map[string]Account `toml:"accounts"`
}

Jump to

Keyboard shortcuts

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