deps

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Docker describes the docker dependency
	Docker = &Dependency{
		Bin: "docker",
	}
	// Yamllint describes the yamllint dependency
	Yamllint = &Dependency{
		Bin: "yamllint",
	}
	// Golint describes the golint dependency
	Golint = &Dependency{
		Bin:       "golint",
		GoInstall: []string{"golang.org/x/lint/golint@latest"},
	}
	// Htmltest describes the htmltest dependency
	Htmltest = &Dependency{
		Bin:       "htmltest",
		GoInstall: []string{"github.com/wjdp/htmltest@latest"},
	}
	// Hugo describes the hugo dependency
	Hugo = &Dependency{
		Bin:       "hugo",
		Env:       map[string]string{"CGO_ENABLED": "1"},
		GoInstall: []string{"-tags", "extended", "github.com/gohugoio/hugo@latest"},
	}
)
View Source
var (
	// ExternalDependencies define the external app dependencies needed
	// to fullfill all automation tasks
	ExternalDependencies = []*Dependency{
		Golint,
	}
)

Functions

func CheckDependencies

func CheckDependencies(ctx context.Context, dependencies ...*Dependency) error

CheckDependencies determines if provided dependencies are available. If binary is not available os.ErrNotExist is returned

func InstallDependencies

func InstallDependencies(ctx context.Context, dependencies ...*Dependency) (bool, error)

InstallDependencies makes sure to install provided dependencies and return if all installing all dependencies were successful

Types

type Dependency

type Dependency struct {
	Bin string
	// GoInstall holds the arguments passed to `go install` (build flags + package path).
	// Example: []string{"-tags", "extended", "github.com/gohugoio/hugo@latest"}
	GoInstall []string
	// Env holds optional environment variables set when running go install.
	// Example: map[string]string{"CGO_ENABLED": "1"}
	Env map[string]string
}

Dependency encapsulates attributes of a depending application

func (*Dependency) Install

func (d *Dependency) Install(ctx context.Context) (result bool, err error)

Install will install the dependency

type Installable

type Installable interface {
	Install() error
}

Installable describes something that can be installed

Jump to

Keyboard shortcuts

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