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) ConfiguredOrganizations() []string
- func (conf *Config) GetGraphQLEndpoint() string
- func (conf *Config) GetTokenForOrg(org string) string
- func (conf *Config) HasConfiguredOrganization(slug string) bool
- func (conf *Config) OrganizationSlug() string
- func (conf *Config) PagerDisabled() bool
- func (conf *Config) PreferredPipelines() []pipeline.Pipeline
- func (conf *Config) RESTAPIEndpoint() string
- func (conf *Config) SelectOrganization(org string, inGitRepo bool) error
- func (conf *Config) SetPreferredPipelines(pipelines []pipeline.Pipeline, inGitRepo bool) error
- func (conf *Config) SetTokenForOrg(org, token string) error
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
func (*Config) ConfiguredOrganizations ¶
func (*Config) GetGraphQLEndpoint ¶ added in v3.4.0
func (*Config) GetTokenForOrg ¶ added in v3.10.0
GetTokenForOrg gets the API token for a specific organization from the user configuration
func (*Config) HasConfiguredOrganization ¶
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) PagerDisabled ¶ added in v3.17.0
func (*Config) PreferredPipelines ¶
PreferredPipelines will retrieve the list of pipelines from local configuration
func (*Config) RESTAPIEndpoint ¶ added in v3.4.0
func (*Config) SelectOrganization ¶
SelectOrganization sets the selected organization in the configuration file
func (*Config) SetPreferredPipelines ¶
SetPreferredPipelines will write the provided list of pipelines to local configuration
func (*Config) SetTokenForOrg ¶
SetTokenForOrg sets the token for the given org in the user configuration file. Tokens are not stored in the local configuration file to reduce the likelihood of tokens being committed to VCS