Versions in this module Expand all Collapse all v1 v1.0.0 Jul 18, 2026 Changes in this version + var ErrNotImplemented = errors.New("versionup: not implemented") + var ErrSkip = errors.New("versionup: skip this archive entry") + func Compare(a, b string) (int, error) + func ExtractArchive(src, dest string, opts ...ArchiveOption) error + func NeedsUpgrade(current, latest string, stable bool) bool + func RunInstaller(path string, args ...string) error + func VerifyChecksum(path, sum string) error + type Applier interface + Apply func(ctx context.Context, pkgPath string, ev UpdateEvent) error + type ArchiveOption func(*archiveConfig) + func WithFileHook(fn func(rel string, r io.Reader) error) ArchiveOption + func WithStripComponents(n int) ArchiveOption + type ArchiveStrategy struct + Dest string + Preserve func(rel string) bool + StripComponents int + func (s ArchiveStrategy) Apply(ctx context.Context, pkg string, ev UpdateEvent) error + type Checker struct + func (c *Checker) CheckOnce(ctx context.Context) (*UpdateEvent, error) + func (c *Checker) Start(ctx context.Context) + type DownloadOption func(*downloadConfig) + func WithChecksum(sum string) DownloadOption + func WithProgress(fn func(done, total int64)) DownloadOption + type Downloader interface + Download func(ctx context.Context, url, dest string, opts ...DownloadOption) error + func NewHTTPDownloader(opts ...DownloaderOption) Downloader + type DownloaderOption func(*httpDownloader) + func WithDownloadClient(c *http.Client) DownloaderOption + type InstallerStrategy struct + Args []string + func (s InstallerStrategy) Apply(ctx context.Context, pkg string, ev UpdateEvent) error + type Logger interface + Printf func(format string, args ...any) + type Notifier interface + Disable func() + Dispatch func(e UpdateEvent) + Enable func() + Enabled func() bool + NotifyAt func(t time.Time, e UpdateEvent) + Subscribe func(obs Observer) + func NewNotifier() Notifier + type Observer func(UpdateEvent) + type Option func(*Updater) + func WithApplier(a Applier) Option + func WithAutoApply(b bool) Option + func WithInterval(d time.Duration) Option + func WithLogger(l Logger) Option + func WithNotifier(n Notifier) Option + func WithReporter(r Reporter) Option + func WithSource(s Source) Option + type Release struct + Checksum string + DownloadURL string + PublishedAt time.Time + ReleaseNotes string + Stable bool + ToolID string + Version string + type Reporter interface + Report func(ctx context.Context, event UpdateEvent) error + func NewHTTPReporter(endpoint string, opts ...ReporterOption) Reporter + type ReporterOption func(*httpReporter) + func WithReporterClient(c *http.Client) ReporterOption + type SelfReplaceStrategy struct + CurrentExe string + func (s SelfReplaceStrategy) Apply(ctx context.Context, pkg string, ev UpdateEvent) error + type Source interface + Latest func(ctx context.Context, toolID string) (*Release, error) + func NewHTTPSource(baseURL string, opts ...SourceOption) Source + func NewManifestSource(rawURL string, opts ...SourceOption) Source + type SourceOption func(*sourceConfig) + func WithSourceClient(c *http.Client) SourceOption + func WithSourceUserAgent(ua string) SourceOption + type UpdateEvent struct + CurrentVersion string + DetectedAt time.Time + DownloadURL string + LatestVersion string + PublishedAt time.Time + ReleaseNotes string + ToolID string + type Updater struct + Checker *Checker + Current string + Notifier Notifier + Reporter Reporter + Source Source + ToolID string + func New(toolID, current string, opts ...Option) *Updater + func (u *Updater) CheckNow(ctx context.Context) (*UpdateEvent, error) + func (u *Updater) OnUpdate(obs Observer) + func (u *Updater) Start(ctx context.Context) error + func (u *Updater) Stop()