config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigExists

func ConfigExists(path string) bool

ConfigExists checks if a configuration file exists at the given path

func GetDefaultConfigPath

func GetDefaultConfigPath() (string, error)

GetDefaultConfigPath returns the default configuration file path

func WriteConfig

func WriteConfig(path string, cfg *Config) error

WriteConfig writes the configuration to a file with proper permissions It creates the directory if it doesn't exist and uses atomic write for safety

Types

type AuthConfig

type AuthConfig struct {
	Token string `yaml:"token"`
	Netrc bool   `yaml:"netrc"`
}

AuthConfig contains authentication settings

type Config

type Config struct {
	GitLab     GitLabConfig     `yaml:"gitlab"`
	Auth       AuthConfig       `yaml:"auth"`
	Validation ValidationConfig `yaml:"validation"`
	Output     OutputConfig     `yaml:"output"`
}

Config represents the application configuration

func GetDefaults

func GetDefaults() Config

GetDefaults returns the default configuration values

type ConfigFlags

type ConfigFlags struct {
	ConfigFile string
	Token      string
	Netrc      bool
	Instance   string
	Timeout    string
	Project    string
	SkipAPI    bool
	Strict     bool
	Output     string
	Verbose    bool
	Color      string
}

ConfigFlags represents CLI flag values

type GitLabConfig

type GitLabConfig struct {
	Instance string        `yaml:"instance"`
	Timeout  time.Duration `yaml:"timeout"`
}

GitLabConfig contains GitLab instance settings

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader handles loading configuration from multiple sources with priority

func NewLoader

func NewLoader(flags *ConfigFlags) *Loader

NewLoader creates a new configuration loader

func (*Loader) Load

func (l *Loader) Load() (*Config, error)

Load loads configuration from all sources and merges them with proper priority Priority (low to high): defaults -> config file -> env vars -> CLI flags

type OutputConfig

type OutputConfig struct {
	Format  string `yaml:"format"` // text, json, yaml
	Verbose bool   `yaml:"verbose"`
	Color   string `yaml:"color"` // auto, always, never
}

OutputConfig contains output formatting settings

type ValidationConfig

type ValidationConfig struct {
	SkipAPI bool   `yaml:"skip_api"`
	Strict  bool   `yaml:"strict"`
	Project string `yaml:"project"`
}

ValidationConfig contains validation behavior settings

Jump to

Keyboard shortcuts

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