update

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoUpdate

func DoUpdate(url string, size int64) error

DoUpdate downloads binary from url and update itself

Types

type Asset

type Asset struct {
	Name        string `json:"name"`
	DownloadURL string `json:"browser_download_url"`
	Version     string `json:"-"`
	Size        int64  `json:"size"`
}

Asset represents github release asset

func GetGithubLatestRelease

func GetGithubLatestRelease(repo string) (Asset, error)

GetGithubLatestRelease returns latest release asset

type GithubReleases

type GithubReleases struct {
	Asset []Asset `json:"assets"`
}

GithubReleases ...

type WriteCounter

type WriteCounter struct {
	Total      uint64
	Downloaded uint64
	URL        string
	Reentry    bool
}

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func (WriteCounter) PrintProgress

func (wc WriteCounter) PrintProgress()

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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