selfupdate

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDevBuild      = errors.New("cannot update a development build")
	ErrAlreadyLatest = errors.New("already running the latest version")
	ErrChecksum      = errors.New("checksum verification failed")
)

Functions

This section is empty.

Types

type CheckInput

type CheckInput struct {
	Version string
}

type Checker

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

func NewChecker

func NewChecker(opts ...Option) *Checker

func (*Checker) Check

func (c *Checker) Check(ctx context.Context, input *CheckInput) (*UpdateResult, error)

func (*Checker) CheckAsync

func (c *Checker) CheckAsync(ctx context.Context, input *CheckInput) <-chan *UpdateResult

func (*Checker) Update added in v0.0.8

func (c *Checker) Update(ctx context.Context, input *UpdateInput, progress func(UpdateProgress)) error

type Option

type Option func(*Checker)

func WithBaseURL

func WithBaseURL(baseURL string) Option

func WithDownloadBaseURL added in v0.0.8

func WithDownloadBaseURL(url string) Option

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type UpdateInput added in v0.0.8

type UpdateInput struct {
	CurrentVersion string
	TargetVersion  string
}

type UpdateProgress added in v0.0.8

type UpdateProgress struct {
	Stage   string
	Message string
}

type UpdateResult

type UpdateResult struct {
	UpdateAvailable bool   `json:"update_available"`
	LatestVersion   string `json:"latest_version"`
	CurrentVersion  string `json:"current_version"`
	ReleaseURL      string `json:"release_url"`
}

Jump to

Keyboard shortcuts

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