config

package
v3.0.0-beta.20240202 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APITokenConfigKey          = "api_token"
	OrganizationsSlugConfigKey = "organizations"
	SelectedOrgKey             = "selected_org"
)

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile() string

Config path precedence: XDG_CONFIG_HOME, AppData (windows only), HOME.

Types

type Config

type Config struct {
	Organization string
	APIToken     string
	V            ViperConfig
}

Config contains the configuration for the currently selected organization to operate on with the CLI application

config file format (yaml):

selected_org: buildkite
organizations:
  buildkite:
    api_token: <token>
  buildkite-oss:
    api_token: <token>

func (*Config) Save

func (conf *Config) Save() error

Save sets the current config values into viper and writes the config file

type ProjectConfig

type ProjectConfig struct {
	Pipeline string `yaml:"pipeline"`
}

func LoadProjectConfig

func LoadProjectConfig() (*ProjectConfig, error)

type ViperConfig

type ViperConfig interface {
	Set(string, interface{})
	GetStringMap(string) map[string]interface{}
	WriteConfig() error
}

Jump to

Keyboard shortcuts

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