cfg

package
v0.0.0-...-fa313d6 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_DIRNAME  = `.gocd`
	CONFIG_FILENAME = `settings`
	CONFIG_FILETYPE = `yaml`
	CONFIG_ENV_PFX  = `gocdcli`
	CONFIG_VERSION  = `config_version`
	CURRENT_VERSION = 1 // format version
)

Variables

This section is empty.

Functions

func Setup

func Setup(configFile string) (err error)

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

func Conf

func Conf() *Config

func NewConfig

func NewConfig(fs afero.Fs) *Config

func (*Config) Bootstrap

func (c *Config) Bootstrap(configFile string, migrations []*migration) error

func (*Config) ConfigFile

func (c *Config) ConfigFile() string

func (*Config) Consume

func (c *Config) Consume(configFile string) error

func (*Config) GetAuth

func (c *Config) GetAuth() map[string]string

func (*Config) GetServerUrl

func (c *Config) GetServerUrl() string

func (*Config) LayerConfigs

func (c *Config) LayerConfigs()

Configures any default values and enables environment variable overrides

func (*Config) Migrate

func (c *Config) Migrate(migrations []*migration) error

func (*Config) SetBasicAuth

func (c *Config) SetBasicAuth(user, pass string) error

func (*Config) SetRequestsAreUnauthenticated

func (c *Config) SetRequestsAreUnauthenticated() error

func (*Config) SetServerUrl

func (c *Config) SetServerUrl(urlArg string) error

func (*Config) SetTokenAuth

func (c *Config) SetTokenAuth(token string) error

func (*Config) Unset

func (c *Config) Unset(key string) error

func (*Config) WithBaseUrlValidation

func (c *Config) WithBaseUrlValidation(urlArg string, onValid func(string) error) error

Jump to

Keyboard shortcuts

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