config

package
v0.0.0-...-9c44a1a Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT, Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(c *Config, name string) error

Load reads the config from the named file.

func Save

func Save(c *Config, name string) (err error)

Save writes the config to the named file.

Types

type Config

type Config struct {
	GithubToken  string `env:"GITHUB_TOKEN" json:"-"`
	Organisation string `env:"LAUNCHPAD_ORG"`
	Editor       string `env:"EDITOR"`

	Save bool     `json:"-"` // save current config to file
	Args []string `json:"-"` // non-config args

	DBPath     string // where to persist data
	LogPath    string // where to persist logs
	CachePath  string // where to cache github data
	ConfigPath string // where to save config
	SourcePath string // where to manage source code

	GithubTokenCommand string // execute to acquire github token
	ExitAfterSelection bool   // exit the app after the first selection
}

Config declares configuration variables for the program.

func Merge

func Merge(configs ...*Config) *Config

Merge merges in the order given. The last config will take precedence over the first, zero values are ignored.

func Parse

func Parse() *Config

Parse prepares a Config by combining values from disk, environment and command line flags, in that order. Command line flags take precedence.

The [GithubToken] is not saved to disk for security reasons.

Jump to

Keyboard shortcuts

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