github

package module
v0.0.0-...-5b475e1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 4 Imported by: 0

README

Logo

github-store

A simple package to be used as a GitHub store for go-update which does not prefix release tag with "v"

GoDoc


go-update is a go package for auto-updating system-specific binaries via GitHub releases.

The current store used by this package automatically prefix the release tag with "v".

Package thegomachine/github-store provides the same API but without prefixing release tag.

Installation

$ go get github.com/thegomachine/github-store

Usage

So previously your code might have looked like this:

import (
    "github.com/tj/go-update/stores/github"
    update "github.com/tj/go-update"
)

func main() {
    project := &update.Manager{
		Command: "foo",
		Store: &github.Store{
			Owner:   "foo",
			Repo:    "bar",
			Version: version,
		},
    }
    release, err := project.Store.GetRelease("1.0.0")
    // will try to find the GitHub release v1.0.0.
 }

With this package:

import (
    "github.com/thegomachine/github-store"
    update "github.com/tj/go-update"
)

func main() {
    project := &update.Manager{
		Command: "foo",
		Store: &github.Store{
			Owner:   "foo",
			Repo:    "bar",
			Version: version,
		},
    }
    release, err := project.Store.GetRelease("1.0.0")
    // will try to find the GitHub release 1.0.0.
 }

Documentation

Overview

Package github provides a GitHub release store.

This package has been directly picked from https://github.com/tj/go-update/blob/master/stores/github/github.go.

It is almost the same, but now tag is no more prefixed with "v".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Owner   string
	Repo    string
	Version string
}

Store is the store implementation.

func (*Store) GetRelease

func (s *Store) GetRelease(version string) (*update.Release, error)

GetRelease returns the specified release or ErrNotFound.

func (*Store) LatestReleases

func (s *Store) LatestReleases() (latest []*update.Release, err error)

LatestReleases returns releases newer than Version, or nil.

Jump to

Keyboard shortcuts

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