v1beta1

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAutoUpdateSecs = 86400

DefaultAutoUpdateSecs is the default auto-update seconds value.

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.

Types

type AutoUpdateConfig

type AutoUpdateConfig struct {
	Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
	Secs     *int `json:"secs,omitempty" yaml:"secs,omitempty"`
}

AutoUpdateConfig configures auto-updates for a formula index.

func (*AutoUpdateConfig) ShouldAutoUpdate

func (au *AutoUpdateConfig) ShouldAutoUpdate(file string) bool

ShouldAutoUpdate returns true if an auto update should be run.

type Configuration

type Configuration struct {
	// Cache sets the path used for caches.
	//
	// Default: $XDG_CACHE_HOME/hops
	Cache string `json:"cache,omitempty" yaml:"cache,omitempty"`

	// Configures Hops' usage of Homebrew's sources.
	Homebrew HomebrewAPIConfig `json:"homebrew,omitempty" yaml:"homebrew,omitempty"`

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

Configuration represents the Hops CLI's configuration file.

func (*Configuration) String

func (cfg *Configuration) String() string

String implements fmt.Stringer.

type HomebrewAPIConfig

type HomebrewAPIConfig struct {

	// Domain to use for the Homebrew API. Overrides Homebrew's HOMEBREW_API_DOMAIN value.
	//
	// Default: https://formulae.brew.sh/api
	Domain string `json:"domain,omitempty" yaml:"domain,omitempty"`

	// Configure auto-update behavior
	AutoUpdate AutoUpdateConfig `json:"autoUpdate,omitempty" yaml:"autoUpdate,omitempty"`
}

HomebrewAPIConfig configures Hops' usage of the Homebrew API.

type RegistryConfig

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

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

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

RegistryConfig configures a Hops-compatible registry for Bottles.

Jump to

Keyboard shortcuts

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