config

package
v0.0.0-...-acbe8ed Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config provides configuration management for the CLI.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrURLRequired is returned when URL is required but not provided.
	ErrURLRequired = errors.New("url is required")
	// ErrAuthRequired is returned when authentication is required.
	ErrAuthRequired = errors.New("authentication required: either email+password or PAT must be configured")
	// ErrConflictingAuth is returned when both email+password and PAT are configured.
	ErrConflictingAuth = errors.New("conflicting authentication: cannot use both email+password and PAT")
)

Functions

func DefaultConfigPath

func DefaultConfigPath() (string, error)

DefaultConfigPath returns the default config file path.

func EnsureDefaults

func EnsureDefaults(path string) error

EnsureDefaults creates a default configuration file if it doesn't exist.

func Save

func Save(path string, cfg *Config) error

Save saves the configuration to the specified path.

func TokenPath

func TokenPath() (string, error)

TokenPath returns the token file path.

Types

type Auth

type Auth struct {
	Email    string `koanf:"email"`
	Password string `koanf:"password"`
	PAT      string `koanf:"pat"`
}

Auth represents authentication configuration.

type Config

type Config struct {
	URL  string `koanf:"url"`
	Org  string `koanf:"org"`
	Auth Auth   `koanf:"auth"`
}

Config represents the CLI configuration.

func Load

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

Load loads configuration from the specified path.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

Jump to

Keyboard shortcuts

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