cli

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 struct is a build for a particular loli version uploaded to GitHub releases. For more information: https://docs.github.com/en/rest/reference/repos#releases For more information: https://golang.org/doc/effective_go.html#names For more information: https://medium.com/better-programming/naming-conventions-in-go-short-but-descriptive-1fa7c6d2f32a

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