config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config manages CLI configuration and settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthFilePath

func AuthFilePath() (string, error)

AuthFilePath returns the credential file beside the configuration file.

func Init

func Init(configFile string) error

Init sets up the configuration system and reads the config file if it exists.

Types

type AuthConfig

type AuthConfig struct {
	Storage string `json:"storage" mapstructure:"storage"`
}

AuthConfig holds persistent credential storage settings.

type Config

type Config struct {
	// Verbose enables detailed output.
	Verbose bool `json:"verbose" mapstructure:"verbose"`

	// NoInteraction disables interactive prompts.
	NoInteraction bool `json:"no_interaction" mapstructure:"no_interaction"`

	// CachePath is the directory for cached downloads.
	CachePath string `json:"cache_path" mapstructure:"cache_path"`

	// Auth selects the persistent credential store.
	Auth AuthConfig `json:"auth" mapstructure:"auth"`

	// OAuth holds OAuth-related settings.
	OAuth OAuthConfig `json:"oauth" mapstructure:"oauth"`
}

Config holds all CLI configuration values.

func Load

func Load() (Config, error)

Load reads the configuration from the config file.

type OAuthConfig

type OAuthConfig struct {
	// BaseURL is the base URL for OAuth endpoints.
	BaseURL string `json:"base_url" mapstructure:"base_url"`

	// ClientID is the OAuth client identifier.
	ClientID string `json:"client_id" mapstructure:"client_id"`

	// Scopes are the OAuth scopes to request.
	Scopes []string `json:"scopes" mapstructure:"scopes"`

	// RedirectPath is the local callback path for the OAuth flow.
	RedirectPath string `json:"redirect_path" mapstructure:"redirect_path"`
}

OAuthConfig holds OAuth endpoint and client configuration.

func (*OAuthConfig) Endpoints

func (cfg *OAuthConfig) Endpoints() *OAuthEndpoints

Endpoints returns the OAuth endpoint URLs.

type OAuthEndpoints

type OAuthEndpoints struct {
	Auth       string
	Token      string
	Introspect string
	Revoke     string
}

OAuthEndpoints holds the OAuth endpoint URLs.

Jump to

Keyboard shortcuts

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