config

package
v0.1.7-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 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 Init

func Init(configFile string) error

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

func Save

func Save() error

Save writes the current configuration to the config file.

Types

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"`

	// 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