version

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version        = "v0.0.0"
	BuildTime      = "1706890000"
	BuildGoVersion = "unknown"
)

Functions

func FormatedVersion

func FormatedVersion() string

Types

type Asset

type Asset struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Size        int    `json:"size"`
	DownloadURL string `json:"browser_download_url"`
}

type DownloadProgress

type DownloadProgress struct {
	Err error
	// contains filtered or unexported fields
}

DownloadCounter 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 (*DownloadProgress) Done

func (dp *DownloadProgress) Done()

func (*DownloadProgress) Progress

func (dp *DownloadProgress) Progress() chan float32

func (*DownloadProgress) Write

func (dp *DownloadProgress) Write(p []byte) (int, error)

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

Downloader check and download the latest version of TPIX CLI.

func (*Downloader) Download

func (d *Downloader) Download(onFinished func()) *DownloadProgress

Download downloads the release file in async manner, and reports its progress.

type GithubRelease

type GithubRelease struct {
	ID          int64     `json:"id"`
	URL         string    `json:"html_url"`
	TagName     string    `json:"tag_name"`
	PublishedAt time.Time `json:"published_at"`
	Body        string    `json:"body"`
	Assets      []Asset   `json:"assets"`
}

type Release

type Release struct {
	Asset
	Version     string
	Changelog   string
	PublishedAt time.Time
}

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

func (*Updater) Check

func (u *Updater) Check() (bool, error)

Check queries che GitHub release API to see if there is a new release compared to the current version of tpix-cli.

func (*Updater) Latest

func (u *Updater) Latest() (*Release, error)

func (*Updater) Update

func (u *Updater) Update() (*DownloadProgress, error)

Update downloads the specified version to disk and replace the current version.

Jump to

Keyboard shortcuts

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