config

package
v0.4.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTransport occurs when a URL transport type is invalid
	ErrInvalidTransport = fmt.Errorf("invalid transport")

	// ErrInvalidAuth occurs when the auth type is invalid
	ErrInvalidAuth = fmt.Errorf("invalid auth")
)

Functions

func CreateGitConfig

func CreateGitConfig(config *Config) (string, []string, error)

CreateGitConfig returns the contents of the /root/.gitconfig file and a list of corresponding password credentials (the passwords are stored as env variables rather than written to disk)

Types

type Config

type Config struct {
	Global GlobalConfig         `yaml:"global"`
	Git    map[string]GitConfig `yaml:"git"`
}

Config contains user's configuration values from ~/earthly/config.yml

func ParseConfigFile

func ParseConfigFile(yamlData []byte) (*Config, error)

ParseConfigFile parse config data

type GitConfig

type GitConfig struct {
	// these are used for global config
	GitURLInsteadOf string `yaml:"url_instead_of"`

	// these are used for git vendors (e.g. github, gitlab)
	Pattern    string `yaml:"pattern"`
	Substitute string `yaml:"substitute"`
	Suffix     string `yaml:"suffix"` // .git
	Auth       string `yaml:"auth"`   // http, https, ssh
	User       string `yaml:"user"`
	Password   string `yaml:"password"`
	KeyScan    string `yaml:"serverkey"`
}

GitConfig contains git-specific config values

type GlobalConfig

type GlobalConfig struct {
	RunPath                 string `yaml:"run_path"`
	DisableAnalytics        bool   `yaml:"disable_analytics"`
	BuildkitCacheSizeMb     int    `yaml:"cache_size_mb"`
	BuildkitImage           string `yaml:"buildkit_image"`
	DebuggerPort            int    `yaml:"debugger_port"`
	BuildkitRestartTimeoutS int    `yaml:"buildkit_restart_timeout_s"`

	// Obsolete.
	CachePath string `yaml:"cache_path"`
}

GlobalConfig contains global config values

Jump to

Keyboard shortcuts

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