config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIURL = "https://us1.oodle.ai"

DefaultAPIURL is the default Oodle API URL.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the path to the configuration file. The path can be overridden by the OODLE_CONFIG environment variable.

Types

type Config

type Config struct {
	APIKey   string `yaml:"api_key"`
	Instance string `yaml:"instance"`
	APIURL   string `yaml:"api_url"`
}

Config holds the resolved Oodle CLI configuration.

func LoadConfig

func LoadConfig(flagAPIKey, flagInstance, flagAPIURL string) (*Config, error)

LoadConfig resolves configuration with the precedence:

CLI flags > env vars > config file > defaults.

Empty strings in flag arguments are treated as "not set".

func (*Config) Save

func (c *Config) Save() error

Save writes the config to the config file path, creating parent directories (mode 0700) and writing the file with mode 0600.

Jump to

Keyboard shortcuts

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