cli

package
v3.0.11+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BuildOS is the operating system (GOOS) used during the build process.
	BuildOS string
	// BuildARM is the ARM version (GOARM) used during the build process.
	BuildARM string
	// BuildARCH is the architecture (GOARCH) used during the build process.
	BuildARCH string
)
View Source
var (
	// TimeoutInSeconds is the timeout the default HTTP client will use.
	TimeoutInSeconds = 60
	// HTTPClient is the client used to make HTTP calls in the cli package.
	HTTPClient = &http.Client{Timeout: time.Duration(TimeoutInSeconds) * time.Second}
	// ReleaseURL is the endpoint that provides information about cli releases.
	ReleaseURL = "https://api.github.com/repos/exercism/cli/releases"
)

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	ContentType string `json:"content_type"`
}

Asset is a build for a particular system, uploaded to a GitHub release.

type CLI

type CLI struct {
	Version       string
	LatestRelease *Release
}

CLI is information about the CLI itself.

func New

func New(version string) *CLI

New creates a CLI, setting it to a particular version.

func (*CLI) IsUpToDate

func (c *CLI) IsUpToDate() (bool, error)

IsUpToDate compares the current version to that of the latest release.

func (*CLI) Upgrade

func (c *CLI) Upgrade() error

Upgrade allows the user to upgrade to the latest version of the CLI.

type Release

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

Release is a specific build of the CLI, released on GitHub.

func (*Release) Version

func (r *Release) Version() string

Version is the CLI version that is built for the release.

type Updater

type Updater interface {
	IsUpToDate() (bool, error)
	Upgrade() error
}

Updater is a simple upgradable file interface.

Jump to

Keyboard shortcuts

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