tools

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Provide(func(p Params) Registry {
	return NewRegistry(p.VendorDir, p.Unpacker, p.Logger)
})

Functions

func NewRegistry

func NewRegistry(vendorDir string, unpacker unpack.Unpacker, logger *zap.SugaredLogger) *registry

Types

type Binary

type Binary struct {
	Name    string                       `json:"name"`
	Path    string                       `json:"path"`
	Targets map[TargetTuple]TargetSource `json:"targets"`
	DstFile string                       `json:"dstFile"`
	// contains filtered or unexported fields
}

func (*Binary) Executable

func (binary *Binary) Executable() string

type Params

type Params struct {
	Logger    *zap.SugaredLogger
	VendorDir string
	Unpacker  unpack.Unpacker
}

type Registry

type Registry interface {
	Install(binaries ...*Binary) error
}

type TargetSource

type TargetSource struct {
	Urls    []string `json:"urls"`
	MD5     string   `json:"md5"`
	SHA256  string   `json:"sha256"`
	DstFile string   `json:"dstFile"`
}

type TargetTuple

type TargetTuple string
const (
	Any         TargetTuple = "any"
	LinuxAMD64  TargetTuple = "linux-amd64"
	LinuxARM64  TargetTuple = "linux-arm64"
	DarwinAMD64 TargetTuple = "darwin-amd64"
	DarwinARM64 TargetTuple = "darwin-arm64"
	Current                 = TargetTuple(runtime.GOOS + "-" + runtime.GOARCH)
)

Jump to

Keyboard shortcuts

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