app

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShellBash = "bash"
	ShellZsh  = "zsh"
	ShellFish = "fish"
)
View Source
const (
	BuildTimeUnknown = "unknown"
	GitTagDefault    = "dev"
)

Variables

This section is empty.

Functions

func CompletionMakeTarget

func CompletionMakeTarget(shell, autocompleteDir string) string

CompletionMakeTarget creates the file and it's parent directories where the completion output can be written to.

func GitHash added in v0.19.0

func GitHash(info *debug.BuildInfo) string

GitHash returns the short git hash of the module.

func GoVersion added in v0.19.0

func GoVersion(info *debug.BuildInfo) string

GoVersion returns the Go version used to build the binary.

Types

type Archiver

type Archiver interface {
	Unarchive(source, target string) error
}

type Asset

type Asset struct {
	Name string `json:"name"`
}

type BuildInfo added in v0.19.0

type BuildInfo struct {
	BuildTime string
	GitHash   string
	GitTag    string
	GoVersion string
}

type Completion

type Completion struct {
	AutocompleteDir string
	BashSymlinkDir  string
	FishSymlinkDir  string
	FS              fs.FS
	CompletionGenerator
	HomeDir       string
	ZshSymlinkDir string
}

Completion generates completion files for zsh/bash/fish shell.

func (*Completion) Run

func (c *Completion) Run(shell string, out io.Writer, useDefault bool) error

Run generates completion file for specified shell. If useDefault is true, the completion file will be generated in the default location for the shell.

type CompletionGenerator

type CompletionGenerator interface {
	GenBashCompletion(io.Writer) error
	GenFishCompletion(out io.Writer, includeDesc bool) error
	GenZshCompletion(io.Writer) error
}

Generator controls how the completion files should be generated

type Content

type Content struct {
	LastModified time.Time
	XMLNAME      xml.Name `xml:"Contents"`
	Key          string
}

Content represents a ListBucketResult object

type Download

type Download struct {
	Dl      *downloader.Downloader
	Timeout time.Duration
}

Download downloads go binaries

func (*Download) Run

func (d *Download) Run(ctx context.Context, version string) error

Run downloads the specified go version

type Install

type Install struct {
	Archiver Archiver
	Dl       *downloader.Downloader
	Timeout  time.Duration
}

func (*Install) Run

func (i *Install) Run(ctx context.Context, ver string) error

Run installs the go version.

type List

type List struct{}

List lists the downloaded go versions

func (List) Run

func (l List) Run(downloadDir, sortDirection string) error

type ListBucketResult

type ListBucketResult struct {
	XMLNAME     xml.Name `xml:"ListBucketResult"`
	NextMarker  string
	Contents    []Content `xml:"Contents"`
	IsTruncated bool
}

ListBucketResult represents the list of objects result

type ListReleasesErrorResp

type ListReleasesErrorResp struct {
	Message          string `json:"message"`
	DocumentationURL string `json:"documentation_url"`
}

type ListReleasesResult

type ListReleasesResult []Release

type ListRemote

type ListRemote struct {
	Client  *http.Client
	Timeout time.Duration
}

ListRemote lists remote versions available for install

func (*ListRemote) Run

func (lsRemote *ListRemote) Run(ctx context.Context, sortDirection string) error

type Release

type Release struct {
	TagName string  `json:"tag_name"`
	Assets  []Asset `json:"assets"`
}

type Update

type Update struct {
	Client *http.Client
	Output io.Writer
}

Update checks for if there are updates available for Godl

func (*Update) CheckForUpdate

func (u *Update) CheckForUpdate(ctx context.Context, currentVersion string) (bool, *Release, error)

func (*Update) Run

func (u *Update) Run(ctx context.Context, currentVersion string) error

type Version added in v0.19.0

type Version struct {
	// contains filtered or unexported fields
}

Version represents the version information of the binary.

func NewVersion added in v0.19.0

func NewVersion(info BuildInfo) Version

func (Version) Run added in v0.19.0

func (v Version) Run(out io.Writer) error

Run prints the version information to the given writer.

Jump to

Keyboard shortcuts

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