Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

elastic/uptd

Repository files navigation

Up To Date Build Status

uptd (shorthand for up to date) is a Go package which provides primitives and mechanisms to check if a version is up to date according to the latest one published in a remote artifact repository.

Installation

To download the source, run: go get github.com/elastic/uptd.

Usage

import (
    "fmt"

    "github.com/elastic/uptd"
)

func main() {
    var githubToken = "your personal github token"

    provider, err := uptd.NewGithubProvider("elastic", "go-licenser", githubToken)
    if err != nil {
        panic(err)
    }

    uptodate, err := uptd.New(provider, version)
    if err != nil {
        panic(err)
    }

    res, err := uptodate.Check()
    if err != nil {
        panic(err)
    }

    if res.NeedsUpdate {
        fmt.Printf(
            "new version %s available, release URL is %s",
            res.Latest.Version.String(), res.Latest.URL,
        )
    }
}

Contributing

See CONTRIBUTING.md.

About

uptd is a software version checker against a remote artifact repository

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published