Documentation
¶
Overview ¶
Package config contains the configuration for the bk CLI
Configuration can come from files or environment variables. File based configuration works similar to unix config file hierarchy where there is a "user" config file found under $HOME, and also a local config in the current repository root (referred to as "local" config)
Index ¶
- Constants
- type Config
- func (conf *Config) APIToken() string
- func (conf *Config) APITokenForOrg(org string) string
- func (conf *Config) ClearAllOrganizations() error
- func (conf *Config) ConfiguredOrganizations() []string
- func (conf *Config) EnsureOrganization(org string) error
- func (conf *Config) GetGraphQLEndpoint() string
- func (conf *Config) HasConfiguredOrganization(slug string) bool
- func (conf *Config) HasStoredTokenForOrg(org string) bool
- func (conf *Config) NoInput() bool
- func (conf *Config) OrganizationSlug() string
- func (conf *Config) OutputFormat() string
- func (conf *Config) Pager() string
- func (conf *Config) PagerDisabled() bool
- func (conf *Config) PreferredPipelines() []pipeline.Pipeline
- func (conf *Config) Quiet() bool
- func (conf *Config) RESTAPIEndpoint() string
- func (conf *Config) SelectOrganization(org string, inGitRepo bool) error
- func (conf *Config) SetNoInput(v bool) error
- func (conf *Config) SetNoPager(v bool, saveLocal bool) error
- func (conf *Config) SetOutputFormat(v string, saveLocal bool) error
- func (conf *Config) SetPager(v string) error
- func (conf *Config) SetPreferredPipelines(pipelines []pipeline.Pipeline) error
- func (conf *Config) SetQuiet(v bool, saveLocal bool) error
- func (conf *Config) SetTelemetry(v bool) error
- func (conf *Config) TelemetryEnabled() bool
Constants ¶
const (
DefaultGraphQLEndpoint = "https://graphql.buildkite.com/v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains the configuration for the currently selected organization to operate on with the CLI application
func (*Config) APIToken ¶
APIToken gets the API token configured for the currently selected organization. Precedence: environment variable > keyring > config file (legacy, read-only with warning)
func (*Config) APITokenForOrg ¶ added in v3.30.0
APITokenForOrg gets the API token for a specific organization. Precedence: environment variable > keyring > config file (legacy, read-only with warning)
func (*Config) ClearAllOrganizations ¶ added in v3.28.1
ClearAllOrganizations removes all organization entries and the selected organization from the user configuration file.
func (*Config) ConfiguredOrganizations ¶
func (*Config) EnsureOrganization ¶ added in v3.31.0
EnsureOrganization records an organization in user config without requiring a token value. This keeps org switching/listing functional for keychain-only token storage.
func (*Config) GetGraphQLEndpoint ¶ added in v3.4.0
func (*Config) HasConfiguredOrganization ¶
func (*Config) HasStoredTokenForOrg ¶ added in v3.31.0
HasStoredTokenForOrg reports whether a token is stored for org in keyring or config files, excluding environment variable overrides.
func (*Config) NoInput ¶ added in v3.22.0
NoInput returns whether interactive input is disabled. Precedence: env > user (not stored in local config)
func (*Config) OrganizationSlug ¶
OrganizationSlug gets the slug for the currently selected organization. This can be configured locally or per user. This will search for configuration in that order.
func (*Config) OutputFormat ¶ added in v3.22.0
OutputFormat returns the configured output format (json, yaml, text). Precedence: env > local > user > default (json)
func (*Config) Pager ¶ added in v3.22.0
Pager returns the configured pager command. Precedence: PAGER env > user config > default (less -R)
func (*Config) PagerDisabled ¶ added in v3.17.0
func (*Config) PreferredPipelines ¶
PreferredPipelines will retrieve the list of pipelines from local configuration
func (*Config) Quiet ¶ added in v3.22.0
Quiet returns whether quiet mode is enabled. Precedence: env > local > user
func (*Config) RESTAPIEndpoint ¶ added in v3.4.0
func (*Config) SelectOrganization ¶
SelectOrganization sets the selected organization in the configuration file
func (*Config) SetNoInput ¶ added in v3.22.0
SetNoInput sets whether interactive input is disabled (user config only)
func (*Config) SetNoPager ¶ added in v3.22.0
func (*Config) SetOutputFormat ¶ added in v3.22.0
func (*Config) SetPreferredPipelines ¶
SetPreferredPipelines will write the provided list of pipelines to local configuration
func (*Config) SetTelemetry ¶ added in v3.23.0
SetTelemetry sets whether telemetry is enabled (user config only)
func (*Config) TelemetryEnabled ¶ added in v3.23.0
TelemetryEnabled returns whether telemetry is enabled. Defaults to true if not explicitly set. Precedence: env > user config