actions

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultConcurrency int = 8

DefaultConcurrency is the default maximum threads for parallel tasks.

Variables

View Source
var (
	Bash        = "bash"         // shell selector
	Csh         = "csh"          // shell selector
	Fish        = "fish"         // shell selector
	Pwsh        = "pwsh"         // shell selector
	PwshPreview = "pwsh-preview" // shell selector
	Sh          = "sh"           // shell selector
	Tcsh        = "tcsh"         // shell selector
	Zsh         = "zsh"          // shell selector

	// Shells lists all supported shells.
	Shells = []string{
		Bash,
		Csh,
		Fish,
		Pwsh,
		Sh,
		Tcsh,
		Zsh,
	}
)

Functions

func IsNewerThan

func IsNewerThan(n *brewv1.Info, o *brewv1.Info) bool

IsNewerThan reports if n is newer than o by comparing their versions.

Types

type Cleanup

type Cleanup struct {
	*Hops
}

Cleanup represents the action and its options.

func (*Cleanup) Run

func (action *Cleanup) Run(_ context.Context) error

Run runs the action.

type Copy

type Copy struct {
	*Hops
	// DependencyOptions dependencies.Options
	DependencyOptions formula.DependencyTags

	File string // path to a Brewfile specifying formulae dependencies

	From hopsv1.RegistryConfig // source registry for bottles
	To   hopsv1.RegistryConfig // destination registry for bottles

	// From          string // source registry for bottles
	// FromOCILayout bool   // use OCI layout directory as source
	// FromPlainHTTP bool   // allow insecure connections to source registry without SSL check
	FromAPIDomain string // HOMEBREW_API_DOMAIN to source metadata from

}

Copy represents the action and its options.

func (*Copy) Run

func (action *Copy) Run(ctx context.Context, args []string) error

Run runs the action.

type Deps

type Deps struct {
	*Hops
	Standalone        bool
	DependencyOptions formula.DependencyTags
	Platform          platform.Platform
}

Deps represents the action and its options.

func (*Deps) Run

func (action *Deps) Run(ctx context.Context, names ...string) error

Tree runs the action.

func (*Deps) Tree

func (action *Deps) Tree(ctx context.Context, names ...string) error

Tree runs the action.

type Hops

type Hops struct {
	ConfigFiles []string // sets the config files to be searched
	EnvFiles    []string // load environment variables from these files
	Concurrency int      // sets the maximum threads for any parallel tasks
	// contains filtered or unexported fields
}

Hops represents the base action.

func NewHops

func NewHops(version string) *Hops

NewHops creates a new Tool with default values.

func (*Hops) AddConfigOverride

func (action *Hops) AddConfigOverride(overrides ...func(cfg *hopsv1.Configuration))

AddConfigOverride adds a configuration override function. The override function will be called when loading hops' configuration.

func (*Hops) AddHomebrewOverride

func (action *Hops) AddHomebrewOverride(overrides ...func(e *brewenv.Environment))

AddHomebrewOverride adds a configuration override function. The override function will be called when loading homebrew's environment configuration.

func (*Hops) AuthClient

func (action *Hops) AuthClient() *auth.Client

Returns the client used for authentication to OCI repositories.

func (*Hops) BottleRegistry

func (action *Hops) BottleRegistry(ctx context.Context) (bottle.Registry, error)

BottleRegistry produces the configured Bottle registry.

func (*Hops) Config

func (action *Hops) Config() *hopsv1.Configuration

Config returns the Hops CLI configuration.

func (*Hops) Formulary

func (action *Hops) Formulary(ctx context.Context) (formula.Formulary, error)

Formulary produces the configured Formulary.

func (*Hops) Homebrew

func (action *Hops) Homebrew() *brewenv.Environment

Homebrew produces the default homebrew client.

func (*Hops) MaxGoroutines

func (action *Hops) MaxGoroutines() int

MaxGoroutines produces the maximum number of Goroutines that should be started at a time.

func (*Hops) Prefix

func (action *Hops) Prefix() prefix.Prefix

Prefix produces the configured prefix.

func (*Hops) SetAlternateTags

func (action *Hops) SetAlternateTags(args []string) (names []string)

SetAlternateVersions sets alternate tags from a list of arguments, and returns the isolated names from the arguments.

func (*Hops) UserAgent

func (action *Hops) UserAgent() string

UserAgent produces the tool's user agent string.

func (*Hops) Version

func (action *Hops) Version() string

Version returns the version (overwritten by main.version if needed).

type Images

type Images struct {
	*Hops
	DependencyOptions formula.DependencyTags

	File      string // path to a Brewfile specifying formulae dependencies
	NoResolve bool   // disable tag resolution
	NoVerify  bool   // disable tag verification
}

Images represents the action and its options.

func (*Images) Run

func (action *Images) Run(ctx context.Context, args ...string) error

Run runs the action.

type Info

type Info struct {
	*Hops

	JSON     string
	Platform platform.Platform
}

Info represents the action and its options.

func (*Info) Run

func (action *Info) Run(ctx context.Context, args ...string) error

Run runs the action.

type Install

type Install struct {
	*Hops

	DependencyOptions formula.DependencyTags

	// Install formulae without checking for previously installed keg-only
	// or non-migrated versions.
	Force bool

	// Show what would be installed, but do not actually install anything.
	DryRun bool

	// An unsupported Homebrew development option to skip installing any
	// dependencies of any kind. If the dependencies are not already
	// present, the formula will have issues. If you're not developing
	// Homebrew, consider adjusting your PATH rather than using this option.
	IgnoreDependencies bool

	// Install the dependencies with specified options but do not install
	// the formula itself
	OnlyDependencies bool

	// Delete files that already exist in the prefix while linking
	Overwrite bool
	// contains filtered or unexported fields
}

Install represents the action and its options.

func (*Install) Run

func (action *Install) Run(ctx context.Context, args ...string) error

Run runs the action.

type Leaves

type Leaves struct {
	*Hops
}

Leaves represents the action and its options.

func (*Leaves) Run

func (action *Leaves) Run(ctx context.Context) error

Run runs the action.

type Link struct {
	*Hops

	Overwrite bool // Delete files that already exist in the prefix while linking
	DryRun    bool // List files which would be linked or deleted by hops link --overwrite without actually linking or deleting any files
	Force     bool // Allow keg-only formulae to be linked
	Head      bool // Link the HEAD version of the formula if it is installed
	// contains filtered or unexported fields
}

Link represents the action and its options.

func (*Link) Run

func (action *Link) Run(ctx context.Context, args ...string) error

Run runs the action.

type List

type List struct {
	*Hops

	// Show the version number for installed
	// formulae, or only the specified formulae if
	// formula are provided
	Versions bool

	// Only show formulae with multiple versions
	// installed
	Multiple bool
}

List represents the action and its options.

func (*List) Run

func (action *List) Run(ctx context.Context, names ...string) error

Run runs the action.

type Reinstall

type Reinstall struct {
	Install
}

Reinstall represents the action and its options.

func (*Reinstall) Run

func (action *Reinstall) Run(ctx context.Context, names ...string) error

Run runs the action.

type Search struct {
	*Hops

	// Search for formulae with a description matching text
	// and casks with a name or description matching text
	Desc bool
}

Search represents the action and its options.

func (*Search) Run

func (action *Search) Run(ctx context.Context, terms ...string) error

Run runs the action.

type ShellEnv

type ShellEnv struct {
	*Hops

	Shell string // selects the shell type
}

ShellEnv represents the action and its options.

func (*ShellEnv) Run

func (action *ShellEnv) Run(_ context.Context) error

Run runs the action.

type Uninstall

type Uninstall struct {
	*Hops
}

Uninstall represents the action and its options.

func (*Uninstall) Run

func (action *Uninstall) Run(ctx context.Context, args []string) error

Run runs the action.

type Unlink struct {
	*Hops

	DryRun bool // List files which would be unlinked without actually unlinking or deleting any files
}

Unlink represents the action and its options.

func (*Unlink) Run

func (action *Unlink) Run(ctx context.Context, args ...string) error

Run runs the action.

type Update

type Update struct {
	*Hops
}

Update represents the action and its options.

func (*Update) Run

func (action *Update) Run(ctx context.Context) error

Run runs the action.

type Upgrade

type Upgrade struct {
	*Hops
}

Upgrade represents the action and its options.

func (*Upgrade) Run

func (action *Upgrade) Run(ctx context.Context, args ...string) error

Run runs the action.

Jump to

Keyboard shortcuts

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