config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotExist

func IsNotExist(err error) bool

func OSConfigPath

func OSConfigPath(homeDir, goos string, lookupEnv func(string) (string, bool)) string

func ResolveConfigPath

func ResolveConfigPath() (string, error)

func ResolveWritablePath

func ResolveWritablePath() (string, error)

func Save

func Save(path string, file *File) error

Types

type CLIOverrides

type CLIOverrides struct {
	All          *bool
	AssetFilters *[]string
	CacheDir     *string
	ProxyURL     *string
	DownloadOnly *bool
	File         *string
	GithubToken  *string
	Name         *string
	Quiet        *bool
	ShowHash     *bool
	Source       *bool
	System       *string
	Tag          *string
	Target       *string
	UpgradeOnly  *bool
	Verify       *string
	DisableSSL   *bool
}

type File

type File struct {
	Meta struct {
		Keys     []string
		MetaData *toml.MetaData
	}
	Global   Section `toml:"global"`
	Repos    map[string]Section
	Packages map[string]Section `toml:"packages"`
}

func Load

func Load() (*File, error)

func LoadFile

func LoadFile(path string) (*File, error)

func LoadFromEnvOrDefault

func LoadFromEnvOrDefault(lookupEnv func(string) (string, bool), homeDir, goos string) (*File, string, error)

func NewFile

func NewFile() *File

type Merged

type Merged struct {
	All          bool
	AssetFilters []string
	CacheDir     string
	ProxyURL     string
	DownloadOnly bool
	File         string
	GithubToken  string
	Name         string
	Quiet        bool
	ShowHash     bool
	Source       bool
	System       string
	Tag          string
	Target       string
	UpgradeOnly  bool
	Verify       string
	DisableSSL   bool
}

func MergeInstallOptions

func MergeInstallOptions(global, repo, pkg Section, cli CLIOverrides) Merged

type Section

type Section struct {
	All          *bool    `toml:"all"`
	AssetFilters []string `toml:"asset_filters"`
	CacheDir     *string  `toml:"cache_dir"`
	ProxyURL     *string  `toml:"proxy_url"`
	DownloadOnly *bool    `toml:"download_only"`
	File         *string  `toml:"file"`
	GithubToken  *string  `toml:"github_token"`
	Name         *string  `toml:"name"`
	Quiet        *bool    `toml:"quiet"`
	Repo         *string  `toml:"repo"`
	ShowHash     *bool    `toml:"show_hash"`
	Source       *bool    `toml:"download_source"`
	System       *string  `toml:"system"`
	Tag          *string  `toml:"tag"`
	Target       *string  `toml:"target"`
	UpgradeOnly  *bool    `toml:"upgrade_only"`
	Verify       *string  `toml:"verify_sha256"`
	DisableSSL   *bool    `toml:"disable_ssl"`
}

Jump to

Keyboard shortcuts

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