config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config provides configuration management for aix using Viper.

Index

Constants

View Source
const AppName = "aix"

AppName is the application name used for config file naming.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() string

DefaultConfigPath returns the default path for the config file. This respects AIX_CONFIG_DIR if set, otherwise uses XDG config home.

func Init

func Init()

Init initializes Viper with default configuration. Call this once at application startup before accessing config values.

Types

type Config

type Config struct {
	Version          int                         `mapstructure:"version" yaml:"version"`
	DefaultPlatforms []string                    `mapstructure:"default_platforms" yaml:"default_platforms"`
	Platforms        map[string]PlatformOverride `mapstructure:"platforms" yaml:"platforms"`
	Repos            map[string]RepoConfig       `mapstructure:"repos" yaml:"repos"`
}

Config represents the top-level configuration structure.

func Load

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

Load reads the configuration file. If path is provided, it reads from that specific file. If path is empty, it searches in the default locations. Returns the loaded configuration or default values if no file is found (when path is empty).

func (*Config) Validate

func (c *Config) Validate() error

Validate checks the configuration for errors.

type PlatformOverride

type PlatformOverride struct {
	ConfigDir string `mapstructure:"config_dir" yaml:"config_dir"`
}

PlatformOverride contains configuration overrides for a specific platform.

type RepoConfig

type RepoConfig struct {
	URL     string    `mapstructure:"url" yaml:"url"`
	Name    string    `mapstructure:"name" yaml:"name"`
	Path    string    `mapstructure:"path" yaml:"path"`
	AddedAt time.Time `mapstructure:"added_at" yaml:"added_at"`
}

RepoConfig contains configuration for a skill repository.

Jump to

Keyboard shortcuts

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