v1beta1

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ConfigurationMatchFiles is a list of patterns used to match a config file for schema validation.
	ConfigurationMatchFiles = apiutil.ConfigDocumentedPath(configurationFileParts...)

	// ConfigurationFile is the default config file location.
	ConfigurationFile = apiutil.DefaultConfigPath(configurationFileParts...)

	// ConfigurationSearchFiles is the possible config file locations in descending priority order.
	ConfigurationSearchFiles = apiutil.ConfigActualPaths(configurationFileParts...)

	// UnevaluatedConfigurationSearchFiles are used for display.
	UnevaluatedSearchFiles = []string{
		strings.Join(configurationFileParts, "-"),
		filepath.Join("$XDG_CONFIG_HOME", filepath.Join(configurationFileParts...)),
		filepath.Join("/", "etc", filepath.Join(configurationFileParts...)),
	}

	// ConfigurationEnvPrefix is the prefix for configuration environment variables.
	ConfigurationEnvPrefix = "HOPS"

	// ConfigurationEnvName is the environment variable name that overrides the search paths.
	ConfigurationEnvName = "HOPS_CONFIG"
)

Functions

func ConfigurationDefault

func ConfigurationDefault(cfg *Configuration)

ConfigurationDefault defaults the object's fields.

func ConfigurationEnvOverrides

func ConfigurationEnvOverrides(cfg *Configuration)

ConfigurationEnvOverrides overrides the configuration with environment variables.

func RegistryConfigEnvOverrides added in v0.2.0

func RegistryConfigEnvOverrides(envPrefix string, cfg *RegistryConfig)

RegistryConfigEnvOverrides overrides the configuration with environment variables.

Types

type Configuration

type Configuration struct {
	// Path prefix for installed packages. Default value depends on OS/Arch.
	Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty" env:"PREFIX"`

	// Path used for caches.
	Cache string `json:"cache,omitempty" yaml:"cache,omitempty" env:"CACHE"`

	// Configuration shared from Homebrew.
	Homebrew brewenv.Configuration `json:"homebrew,omitempty" yaml:"homebrew,omitempty" envPrefix:"HOMEBREW_"`

	// Registry configures a Hops-compatible registry for Bottles.
	Registry RegistryConfig `json:"registry,omitempty" yaml:"registry,omitempty" envPrefix:"REGISTRY_"`
}

Configuration represents the Hops CLI's configuration file.

func (*Configuration) LogValue added in v0.2.0

func (cfg *Configuration) LogValue() slog.Value

LogValuer implements slog.LogValuer.

func (*Configuration) String

func (cfg *Configuration) String() string

String implements fmt.Stringer.

type RegistryConfig

type RegistryConfig struct {
	// Prefix is the prefix for all Bottle repositories
	Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty" env:",inline"`

	// Headers adds custom headers to requests
	Headers []string `json:"headers,omitempty" yaml:"headers,omitempty" env:"HEADERS"`

	// Insecure	allows connections to SSL registry without certs
	Insecure bool `json:"insecure,omitempty" yaml:"insecure,omitempty" env:"INSECURE"`

	// OCILayout sets the registry as an OCI image layout
	OCILayout bool `json:"ociLayout,omitempty" yaml:"ociLayout,omitempty" env:"OCI_LAYOUT"`

	// PlainHTTP allows insecure connections to registry without SSL check
	PlainHTTP bool `json:"plainHTTP,omitempty" yaml:"plainHTTP,omitempty" env:"PLAIN_HTTP"`

	// Config sets the path of the authentication file for the registry
	Config string `json:"config,omitempty" yaml:"config,omitempty" env:"CONFIG"`
}

RegistryConfig configures a Hops-compatible registry for Bottles.

func (*RegistryConfig) ParseHeaders added in v0.2.0

func (cfg *RegistryConfig) ParseHeaders() (map[string][]string, error)

ParseHeaders parses the configured HTTP headers.

Jump to

Keyboard shortcuts

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