config

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigPathFunc = getDefaultConfigPath

ConfigPathFunc is a function variable that returns the config file path This can be overridden in tests

Functions

func DeleteAlias

func DeleteAlias(name string) error

DeleteAlias removes an alias

func GetAlias

func GetAlias(name string) (string, error)

GetAlias retrieves a specific alias by name

func GetConfigPath

func GetConfigPath() (string, error)

GetConfigPath returns the path to the config file

func ImportAliases

func ImportAliases(filepath string) error

ImportAliases imports aliases from a YAML file

func LoadAliases

func LoadAliases() (map[string]string, error)

LoadAliases loads aliases from the config file

func SaveAliases

func SaveAliases(aliases map[string]string) error

SaveAliases saves aliases to the config file

func SetAlias

func SetAlias(name, command string) error

SetAlias sets or updates an alias

Types

type AliasConfig

type AliasConfig struct {
	Aliases map[string]string `yaml:"aliases"`
}

AliasConfig represents the alias configuration structure

type Config

type Config struct {
	APIKey      string
	AppKey      string
	Site        string
	AutoApprove bool
	AgentMode   bool
}

Config holds the application configuration

func Load

func Load() (*Config, error)

Load loads configuration from environment variables

func (*Config) GetAPIURL

func (c *Config) GetAPIURL() string

GetAPIURL returns the full API URL for the configured site

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if required configuration is present Note: This only validates the site. Authentication can be via OAuth2 or API keys, which is checked in the client package.

Jump to

Keyboard shortcuts

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