config

package
v0.8.17 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

	// DefaultDarwinProxyImage is the image tag used for the Docker Desktop registry proxy on Darwin.
	DefaultDarwinProxyImage = "alpine/socat:1.7.4.4"

	// DefaultDarwinProxyWait is the maximum time to wait for the Darwin registry proxy support container
	// to become available.
	DefaultDarwinProxyWait = 10 * time.Second

	// 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
	// EarthBuild uses internally to generate LLB for BuildKit to consume.
	DefaultConversionParallelism = 10

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

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

	// DefaultCAKey is the default path to use when looking for a CA key to use for TLS cert generation.
	DefaultCAKey = "./certs/ca_key.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

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 PortOffset

func PortOffset(installationName string) int

PortOffset is the offset to use for dev ports.

func PrintHelp

func PrintHelp(path string) error

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

func ReadConfigFile

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

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

func Upsert

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

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

WriteConfigFile writes the config file to disk with preset permission 0644.

Types

type Config

type Config struct {
	Git    map[string]GitConfig `help:"Git configuration object. Requires YAML literal to set directly."    yaml:"git"`
	Global GlobalConfig         `help:"Global configuration object. Requires YAML literal to set directly." yaml:"global"`
}

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

func ParseYAML

func ParseYAML(yamlData []byte, installationName string) (Config, error)

ParseYAML parse config data in yaml format.

type GitConfig

type GitConfig struct {
	StrictHostKeyChecking *bool `` //nolint:lll
	/* 311-byte string literal not displayed */
	Pattern string `` //nolint:lll
	/* 294-byte string literal not displayed */
	Substitute string `` //nolint:lll
	/* 297-byte string literal not displayed */
	Suffix string `` //nolint:lll // .git
	/* 293-byte string literal not displayed */
	Auth string `` //nolint:lll // http, https, ssh
	/* 291-byte string literal not displayed */
	User string `` //nolint:lll
	/* 291-byte string literal not displayed */
	Prefix string `` //nolint:lll
	/* 293-byte string literal not displayed */
	Password string `` //nolint:lll
	/* 295-byte string literal not displayed */
	ServerKey string `` //nolint:lll
	/* 296-byte string literal not displayed */
	SSHCommand string `` //nolint:lll
	/* 298-byte string literal not displayed */
	Port int `` //nolint:lll
	/* 291-byte string literal not displayed */
}

GitConfig contains git-specific config values.

type GlobalConfig

type GlobalConfig struct {
	DarwinProxyImage string `` //nolint:lll
	/* 182-byte string literal not displayed */
	ServerTLSKey string `` //nolint:lll
	/* 180-byte string literal not displayed */
	BuildkitScheme string `` //nolint:lll
	/* 182-byte string literal not displayed */
	BuildkitImage string `` //nolint:lll
	/* 178-byte string literal not displayed */
	CachePath string `` //nolint:lll
	/* 174-byte string literal not displayed */
	SecretProvider string `` //nolint:lll
	/* 179-byte string literal not displayed */
	BuildkitAdditionalConfig string `` //nolint:lll
	/* 190-byte string literal not displayed */
	IPTables string `` //nolint:lll
	/* 173-byte string literal not displayed */
	ContainerFrontend string `` //nolint:lll
	/* 182-byte string literal not displayed */
	ServerTLSCert string `` //nolint:lll
	/* 181-byte string literal not displayed */
	BuildkitHost string `` //nolint:lll
	/* 177-byte string literal not displayed */
	TLSCACert string `` //nolint:lll
	/* 169-byte string literal not displayed */
	ClientTLSKey string `` //nolint:lll
	/* 170-byte string literal not displayed */
	GitImage string `` //nolint:lll
	/* 173-byte string literal not displayed */
	LocalRegistryHost string `` //nolint:lll
	/* 183-byte string literal not displayed */
	TLSCAKey string `` //nolint:lll
	/* 173-byte string literal not displayed */
	ClientTLSCert string `` //nolint:lll
	/* 171-byte string literal not displayed */
	BuildkitAdditionalArgs []string `` //nolint:lll
	/* 188-byte string literal not displayed */
	BuildkitCacheSizePct int `` //nolint:lll
	/* 178-byte string literal not displayed */
	BuildkitCacheSizeMb int `` //nolint:lll
	/* 177-byte string literal not displayed */
	ConversionParallelism int `` //nolint:lll
	/* 186-byte string literal not displayed */
	BuildkitMaxParallelism int `` //nolint:lll
	/* 188-byte string literal not displayed */
	DarwinProxyWait time.Duration `` //nolint:lll
	/* 181-byte string literal not displayed */
	BuildkitRestartTimeoutS int `` //nolint:lll
	/* 190-byte string literal not displayed */
	BuildkitCacheKeepDurationS int `` //nolint:lll
	/* 194-byte string literal not displayed */
	CniMtu uint16 `` //nolint:lll
	/* 171-byte string literal not displayed */
	TLSEnabled bool `` //nolint:lll
	/* 175-byte string literal not displayed */
}

GlobalConfig contains global config values.

Jump to

Keyboard shortcuts

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