Documentation ¶
Overview ¶
Package sgtool provides primitives for downloading and invoking tools.
Index ¶
- Constants
- func CreateSymlink(src string) (string, error)
- func FromLocal(_ context.Context, filepath string, opts ...Opt) error
- func FromRemote(ctx context.Context, addr string, opts ...Opt) error
- func GoInstall(ctx context.Context, pkg, version string) (string, error)
- func GoInstallWithModfile(ctx context.Context, pkg, file string) (string, error)
- type Opt
Constants ¶
View Source
const ( None archiveType = iota Zip Tar TarGz )
View Source
const ( AMD64 = "amd64" X8664 = "x86_64" ARM64 = "arm64" )
View Source
const (
Darwin = "darwin"
)
Variables ¶
This section is empty.
Functions ¶
func CreateSymlink ¶
Types ¶
type Opt ¶
type Opt func(f *fileState)
func WithDestinationDir ¶
func WithHTTPHeader ¶ added in v0.87.0
func WithRenameFile ¶
WithRenameFile renames a source file to the given destination file when writing it. For archives the source file should be the path relative to the root of the archive. If the archive does not contain a file with a matching src path, it is ignored. For direct downloads (no archive) the src does not matter and the output file is stored as per dst. The output file is stored relative to the destination dir given by WithDestinationDir.
func WithSkipIfFileExists ¶
func WithSymlink ¶
func WithUntarGz ¶
func WithUntarGz() Opt
Click to show internal directories.
Click to hide internal directories.