app

package
v0.44.7 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenInstaller added in v0.25.0

func GenInstaller(config Config) ([]byte, string, error)

GenInstaller generates an instaler script from the app configuration. It returns a byte slice of the generated installer script, its SHA-256 digest as a hexadecimal string, and any error encountered.

func IsUserConfigExists added in v0.44.1

func IsUserConfigExists(configPath string) bool

IsUserConfigExists checks if the user config file exists at the given path.

func Main

func Main(config Config)

Main runs the Hermit command-line application with the given config.

Types

type Config

type Config struct {
	Version     string
	LogLevel    ui.Level
	BaseDistURL string
	// Possible system-wide installation paths
	InstallPaths []string
	// SHA256 checksums for all known versions of per-environment scripts.
	// If empty shell.ScriptSHAs will be used.
	SHA256Sums  []string
	HTTP        func(HTTPTransportConfig) *http.Client
	State       state.Config
	KongOptions []kong.Option
	KongPlugins kong.Plugins
	// Defaults to cache.GetSource if nil.
	PackageSourceSelector cache.PackageSourceSelector
	// True if we're running in CI - disables progress bar.
	CI bool
}

Config for the main Hermit application.

type GlobalState added in v0.2.2

type GlobalState struct {
	Env envars.Envars `help:"Extra environment variables to apply to environments."`
}

GlobalState configurable by user to be passed through to Hermit.

type HTTPTransportConfig

type HTTPTransportConfig struct {
	ResponseHeaderTimeout time.Duration
	DialTimeout           time.Duration
	KeepAlive             time.Duration
}

HTTPTransportConfig defines the configuration for HTTP transports used by Hermit.

type JSONFormattable added in v0.21.0

type JSONFormattable struct {
	JSON bool `help:"Format information as a JSON array" default:"false"`
}

JSONFormattable contains the shared JSON boolean flag for Kong

type UserConfig added in v0.2.18

type UserConfig struct {
	Prompt      string        `` /* 154-byte string literal not displayed */
	ShortPrompt bool          `hcl:"short-prompt,optional" help:"If true use a short prompt when an environment is activated."`
	NoGit       bool          `hcl:"no-git,optional" help:"If true Hermit will never add/remove files from Git automatically."`
	Idea        bool          `hcl:"idea,optional" help:"If true Hermit will try to add the IntelliJ IDEA plugin automatically."`
	Defaults    hermit.Config `hcl:"defaults,block,optional" help:"Default configuration values for new Hermit environments."`
}

UserConfig is stored in ~/.hermit.hcl

func LoadUserConfig added in v0.2.18

func LoadUserConfig(configPath string) (UserConfig, error)

LoadUserConfig from disk.

Jump to

Keyboard shortcuts

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