config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath

func DefaultConfigPath() (string, error)

func SaveConfig

func SaveConfig(cfg *Config, path string) error

Types

type Config

type Config struct {
	ActiveContext string             `mapstructure:"active_context" json:"active_context" yaml:"active_context"`
	Contexts      map[string]Context `mapstructure:"contexts" json:"contexts" yaml:"contexts"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

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

func (*Config) GetActiveContext

func (c *Config) GetActiveContext() (*Context, string, error)

func (*Config) Redacted

func (c *Config) Redacted() *Config

type Context

type Context struct {
	URL                string            `mapstructure:"url" json:"url" yaml:"url"`
	APIToken           string            `mapstructure:"api_token,omitempty" json:"api_token,omitempty" yaml:"api_token,omitempty"`
	Username           string            `mapstructure:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty"`
	Password           string            `mapstructure:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty"`
	HTTPUser           string            `mapstructure:"http_user,omitempty" json:"http_user,omitempty" yaml:"http_user,omitempty"`
	HTTPPassword       string            `mapstructure:"http_password,omitempty" json:"http_password,omitempty" yaml:"http_password,omitempty"`
	HTTPHeaders        map[string]string `mapstructure:"http_headers,omitempty" json:"http_headers,omitempty" yaml:"http_headers,omitempty"`
	TLSCertFile        string            `mapstructure:"tls_cert_file,omitempty" json:"tls_cert_file,omitempty" yaml:"tls_cert_file,omitempty"`
	TLSKeyFile         string            `mapstructure:"tls_key_file,omitempty" json:"tls_key_file,omitempty" yaml:"tls_key_file,omitempty"`
	TLSCAFile          string            `mapstructure:"tls_ca_file,omitempty" json:"tls_ca_file,omitempty" yaml:"tls_ca_file,omitempty"`
	SafetyLevel        string            `mapstructure:"safety_level" json:"safety_level" yaml:"safety_level"`
	OutputFormat       string            `mapstructure:"output_format" json:"output_format" yaml:"output_format"`
	Timeout            int               `mapstructure:"timeout" json:"timeout" yaml:"timeout"`
	InsecureSkipVerify bool              `mapstructure:"insecure_skip_verify" json:"insecure_skip_verify" yaml:"insecure_skip_verify"`
}

func (Context) Redacted

func (c Context) Redacted() Context

Jump to

Keyboard shortcuts

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