config

package
v0.6.18 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDebuggerPort is the default user-facing port for the debugger.
	DefaultDebuggerPort = 8373

	// DefaultLocalRegistryPort is the default user-facing port for the local registry used for exports.
	DefaultLocalRegistryPort = 8371

	// DefaultBuildkitScheme is the default scheme earthly uses to connect to its buildkitd. tcp or docker-container.
	DefaultBuildkitScheme = "docker-container"

	// DefaultConversionParallelism is the default conversion parallelism that Earthly uses internally to generate LLB for BuildKit to consume.
	DefaultConversionParallelism = 10

	// DefaultBuildkitMaxParallelism is the default max parallelism for buildkit workers.
	DefaultBuildkitMaxParallelism = 20

	// DefaultCA is the default path to use when looking for a CA to use for TLS
	DefaultCA = "./certs/ca_cert.pem"

	// DefaultClientTLSCert is the default path to use when looking for the Earthly TLS cert
	DefaultClientTLSCert = "./certs/earthly_cert.pem"

	// DefaultClientTLSKey is the default path to use when looking for the Earthly TLS key
	DefaultClientTLSKey = "./certs/earthly_key.pem"

	// DefaultServerTLSCert is the default path to use when looking for the Buildkit TLS cert
	DefaultServerTLSCert = "./certs/buildkit_cert.pem"

	// DefaultServerTLSKey is the default path to use when looking for the Buildkit TLS key
	DefaultServerTLSKey = "./certs/buildkit_key.pem"

	// DefaultContainerFrontend is the default frontend program or interfacing with the running containers and saved images
	DefaultContainerFrontend = "auto"
)

Variables

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

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

Functions

func Delete added in v0.6.15

func Delete(config []byte, path string) ([]byte, error)

Delete removes the key and value at the specified path. If no key/value exists, the function will eventually return cleanly.

func PrintHelp added in v0.6.15

func PrintHelp(path string) error

PrintHelp describes the provided config option by printing its type and help tags to the console.

func ReadConfigFile added in v0.6.15

func ReadConfigFile(configPath string) ([]byte, error)

ReadConfigFile reads in the config file from the disk, into a byte slice.

func Upsert added in v0.6.15

func Upsert(config []byte, path, value string) ([]byte, error)

Upsert adds or modifies the key to be the specified value. This is saved to disk in your earthly config file.

func WriteConfigFile added in v0.6.15

func WriteConfigFile(configPath string, data []byte) error

WriteConfigFile writes the config file to disk with preset permission 0644

Types

type Config

type Config struct {
	Global    GlobalConfig         `yaml:"global"    help:"Global configuration object. Requires YAML literal to set directly."`
	Git       map[string]GitConfig `yaml:"git"       help:"Git configuration object. Requires YAML literal to set directly."`
	Satellite Satellite            `` /* 162-byte string literal not displayed */
}

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 git vendors (e.g. github, gitlab)
	Pattern               string ``                                                                                                                       /* 238-byte string literal not displayed */
	Substitute            string ``                                                                                                                       /* 315-byte string literal not displayed */
	Suffix                string `yaml:"suffix"                       help:"The git repository suffix, like .git."`                                       // .git
	Auth                  string `yaml:"auth"                         help:"What authentication method do you use? Valid options are: http, https, ssh."` // http, https, ssh
	User                  string `yaml:"user"                         help:"The username to use when auth is set to git or https."`
	Port                  int    `yaml:"port"                         help:"The port to connect to when using git; has no effect for http(s)."`
	Prefix                string `` /* 131-byte string literal not displayed */
	Password              string `` /* 137-byte string literal not displayed */
	ServerKey             string `` /* 130-byte string literal not displayed */
	StrictHostKeyChecking *bool  `` /* 145-byte string literal not displayed */
}

GitConfig contains git-specific config values

type GlobalConfig

type GlobalConfig struct {
	DisableAnalytics         bool     `yaml:"disable_analytics"          help:"Controls Earthly telemetry."`
	BuildkitCacheSizeMb      int      `yaml:"cache_size_mb"              help:"Size of the buildkit cache in Megabytes."`
	BuildkitCacheSizePct     int      `yaml:"cache_size_pct"             help:"Size of the buildkit cache, as percentage (0-100)."`
	BuildkitImage            string   `yaml:"buildkit_image"             help:"Choose a specific image for your buildkitd."`
	BuildkitRestartTimeoutS  int      `yaml:"buildkit_restart_timeout_s" help:"How long to wait for buildkit to (re)start, in seconds."`
	BuildkitAdditionalArgs   []string `` /* 162-byte string literal not displayed */
	BuildkitAdditionalConfig string   `` /* 147-byte string literal not displayed */
	BuildkitMaxParallelism   int      `yaml:"buildkit_max_parallelism"   help:"Max parallelism for builtkit workers"`
	ConversionParallelism    int      `` /* 184-byte string literal not displayed */
	CniMtu                   uint16   `` /* 129-byte string literal not displayed */
	BuildkitHost             string   `yaml:"buildkit_host"              help:"The URL of your buildkit, remote or local."`
	DebuggerHost             string   `yaml:"debugger_host"              help:"The URL of the Earthly debugger, remote or local."`
	LocalRegistryHost        string   `yaml:"local_registry_host"        help:"The URL of the local registry used for image exports to Docker."`
	TLSCA                    string   `` /* 140-byte string literal not displayed */
	ClientTLSCert            string   `` /* 144-byte string literal not displayed */
	ClientTLSKey             string   `` /* 143-byte string literal not displayed */
	ServerTLSCert            string   `` /* 185-byte string literal not displayed */
	ServerTLSKey             string   `` /* 184-byte string literal not displayed */
	TLSEnabled               bool     `` /* 135-byte string literal not displayed */
	ContainerFrontend        string   `` /* 187-byte string literal not displayed */
	IPTables                 string   `` /* 148-byte string literal not displayed */
	DisableLogSharing        bool     `` /* 146-byte string literal not displayed */
	SecretProvider           string   `yaml:"secret_provider"            help:"Command to execute to retrieve secret."`

	// Obsolete.
	CachePath      string `yaml:"cache_path"         help:" *Deprecated* The path to keep Earthly's cache."`
	DebuggerPort   int    `` /* 129-byte string literal not displayed */
	BuildkitScheme string `` /* 167-byte string literal not displayed */
}

GlobalConfig contains global config values

type Satellite added in v0.6.15

type Satellite struct {
	Name string `yaml:"name" help:"The name of the satellite to use"`
	Org  string `yaml:"org"  help:"The org name to whom the satellite belongs"`
}

Satellite contains satellite config values

Jump to

Keyboard shortcuts

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