Documentation ¶
Index ¶
- Constants
- Variables
- func Add(tools ...Tool)
- func Bin(ctx context.Context, binary string, platform Platform) string
- func Checksum(file string) (string, error)
- func DevDir(ctx context.Context) string
- func Ensure(ctx context.Context, toolName Name, platform Platform) error
- func EnsureAll(ctx context.Context, _ types.DepsFunc) error
- func EnvDir(ctx context.Context) string
- func GetName(ctx context.Context) string
- func GetVersion(ctx context.Context) string
- func LinkFiles(ctx context.Context, platform Platform, tool Tool, binaries []string) error
- func PlatformDir(ctx context.Context, platform Platform) string
- func ShouldReinstall(ctx context.Context, platform Platform, tool Tool, dst, src string) bool
- func ToolDownloadDir(ctx context.Context, platform Platform, tool Tool) string
- func ToolLinksDir(ctx context.Context, platform Platform, tool Tool) string
- func VerifyChecksums(ctx context.Context, _ types.DepsFunc) error
- func VersionDir(ctx context.Context, platform Platform) string
- func WithName(ctx context.Context, name string) context.Context
- func WithVersion(ctx context.Context, version string) context.Context
- type BinaryTool
- type Name
- type Platform
- type Source
- type Sources
- type Tool
Constants ¶
const ( OSLinux = "linux" OSDarwin = "darwin" OSDocker = "docker" ArchAMD64 = "amd64" ArchARM64 = "arm64" )
Platform constants.
Variables ¶
var ( PlatformLocal = Platform{OS: runtime.GOOS, Arch: runtime.GOARCH} PlatformLinuxAMD64 = Platform{OS: OSLinux, Arch: ArchAMD64} PlatformDarwinAMD64 = Platform{OS: OSDarwin, Arch: ArchAMD64} PlatformDarwinARM64 = Platform{OS: OSDarwin, Arch: ArchARM64} PlatformDocker = Platform{OS: OSDocker, Arch: runtime.GOARCH} PlatformDockerAMD64 = Platform{OS: OSDocker, Arch: ArchAMD64} PlatformDockerARM64 = Platform{OS: OSDocker, Arch: ArchARM64} )
Platform definitions.
Functions ¶
func GetVersion ¶ added in v2.1.0
GetVersion returns version passed to `Main` function
func PlatformDir ¶
PlatformDir returns the directory where platform-specific stuff is stored.
func ShouldReinstall ¶
ShouldReinstall check if tool should be reinstalled due to missing files or links.
func ToolDownloadDir ¶
ToolDownloadDir returns directory where tool is downloaded.
func ToolLinksDir ¶
ToolLinksDir returns directory where tools should be linked.
func VerifyChecksums ¶
VerifyChecksums of all the tools.
func VersionDir ¶
VersionDir returns path to the version directory.
Types ¶
type BinaryTool ¶
BinaryTool is the tool having compiled binaries available on the internet.
func (BinaryTool) Ensure ¶
func (bt BinaryTool) Ensure(ctx context.Context, platform Platform) error
Ensure ensures the tool is installed.
func (BinaryTool) GetName ¶
func (bt BinaryTool) GetName() Name
GetName returns the anme of the tool.
func (BinaryTool) GetVersion ¶
func (bt BinaryTool) GetVersion() string
GetVersion returns the version of the tool.
func (BinaryTool) IsCompatible ¶
func (bt BinaryTool) IsCompatible(platform Platform) (bool, error)
IsCompatible checks if tool is compatible with the platform.