update

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitAssets

type GitAssets struct {
	Url       string `json:"browser_download_url"`
	TimeStamp string `json:"updated_at"`
	FileSize  uint64 `json:"size"`
	TagName   string
}

func GetRelease

func GetRelease(url string, pattern string) (asset *GitAssets, tag string)

type GitRelease

type GitRelease struct {
	TagName   string `json:"tag_name"`
	Name      string `json:"name"`
	AssetsUrl string `json:"assets_url"`
	TimeStamp string `json:"published_at"`
}

type Updater

type Updater struct {
}

func NewUpdaterObj

func NewUpdaterObj() (result *Updater)

func (*Updater) Copy

func (obj *Updater) Copy(src string, dst string) (int64, error)

func (*Updater) DownloadFile

func (obj *Updater) DownloadFile(filepath string, url string, fileSize uint64) error

func (*Updater) ExtractExec

func (obj *Updater) ExtractExec(zipfile string, destinationDir string) (err error)

type WriteCounter

type WriteCounter struct {
	Total uint64
	Max   uint64
}

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