config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config provides configuration file support for Aha Studio.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the configuration directory path.

Types

type Config

type Config struct {
	// Defaults contains default settings.
	Defaults Defaults `yaml:"defaults,omitempty"`

	// Profiles contains named connection profiles.
	Profiles map[string]Profile `yaml:"profiles,omitempty"`

	// Queries contains saved named queries.
	Queries map[string]string `yaml:"queries,omitempty"`
	// contains filtered or unexported fields
}

Config represents the Aha Studio configuration.

func Load

func Load() (*Config, error)

Load loads the configuration from the default location.

func LoadFrom

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

LoadFrom loads the configuration from the specified path.

func (*Config) DeleteQuery

func (c *Config) DeleteQuery(name string)

DeleteQuery deletes a named query.

func (*Config) GetProfile

func (c *Config) GetProfile(name string) (Profile, bool)

GetProfile returns a connection profile by name.

func (*Config) GetQuery

func (c *Config) GetQuery(name string) (string, bool)

GetQuery retrieves a named query.

func (*Config) Save

func (c *Config) Save() error

Save saves the configuration to disk.

func (*Config) SaveQuery

func (c *Config) SaveQuery(name, query string)

SaveQuery saves a named query.

type Defaults

type Defaults struct {
	// Output is the default output format (table, json, csv).
	Output string `yaml:"output,omitempty"`

	// Product is the default product ID or reference.
	Product string `yaml:"product,omitempty"`

	// PerPage is the default results per page.
	PerPage int `yaml:"per_page,omitempty"`

	// Profile is the default connection profile.
	Profile string `yaml:"profile,omitempty"`
}

Defaults contains default settings.

type Profile

type Profile struct {
	// Subdomain is the Aha account subdomain.
	Subdomain string `yaml:"subdomain,omitempty"`

	// APIKeyEnv is the environment variable containing the API key.
	APIKeyEnv string `yaml:"api_key_env,omitempty"`
}

Profile contains connection profile settings.

Jump to

Keyboard shortcuts

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