update

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package update provides methods to find the version of the package and update it.

Index

Constants

This section is empty.

Variables

View Source
var VERSION = "v0.6.0"

VERSION of instahelper

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Name        string `json:"name"`
	DownloadURL string `json:"browser_download_url"`
	Size        int    `json:"size"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
}

Asset is a single download and it's various info for a github release

func To

func To(ver string) (*Asset, error)

To will replace the current binary with the binary with version ver. Will return error if ver not found Update is allowed to update to a lower version

func ToLatest

func ToLatest(version string) (*Asset, error)

ToLatest replaces the binary runnning this command with the latest binary available on github releases If version is an empty string, it will fetch and replace the binary no matter what. Else it will only replace it if the version is greater than the current version

type Release

type Release struct {
	Name        string  `json:"name,omitempty"`
	Description string  `json:"body,omitempty"`
	Version     string  `json:"tag_name,omitempty"`
	URL         string  `json:"url,omitempty"`
	ID          int     `json:"id,omitempty"`
	PreRelease  bool    `json:"prerelease,omitempty"`
	PublishedAt string  `json:"published_at,omitempty"`
	Assets      []Asset `json:"assets,omitempty"`
	InfoURL     string  `json:"html_url,omitempty"`
}

Release is a github release

func ListReleases

func ListReleases() ([]Release, error)

ListReleases collects information about github releases

func (*Release) Semver

func (r *Release) Semver() (*semver.Version, error)

Semver will return a semver.Version from the release version

Jump to

Keyboard shortcuts

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