cli

package
v3.0.0-alpha.3+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2017 License: MIT Imports: 18 Imported by: 9

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 (
	// HTTPClient is the client used to make HTTP calls in the cli package.
	HTTPClient = &http.Client{Timeout: 10 * time.Second}
	// LatestReleaseURL is the endpoint that provides information about the latest release.
	LatestReleaseURL = "https://api.github.com/repos/exercism/cli/releases/latest"
)

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 Status

type Status struct {
	Censor          bool
	Version         versionStatus
	System          systemStatus
	Configuration   configurationStatus
	APIReachability apiReachabilityStatus
	// contains filtered or unexported fields
}

Status represents the results of a CLI self test.

func NewStatus

func NewStatus(c *CLI, uc config.UserConfig) Status

NewStatus prepares a value to perform a diagnostic self-check.

func (*Status) Check

func (status *Status) Check() (string, error)

Check runs the CLI's diagnostic self-check.

Jump to

Keyboard shortcuts

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