github

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APILatest is a format string for the Latest releases API
	APILatest = "https://api.github.com/repos/%s/releases/latest"
	// APIReleases is a format string for the Releases API
	APIReleases = "https://api.github.com/repos/%s/releases"
	// APITags is a format string for the Tags API
	APITags = "https://api.github.com/repos/%s/git/refs/tags"
	// SourceFormat is the format string for Github release tarballs
	SourceFormat = "https://github.com/%s/archive/%s.tar.gz"
)

Variables

View Source
var SourceRegex = regexp.MustCompile("https?://github.com/([^/]*/[^/]*)/.*/[^/]*.tar.gz")

SourceRegex is the regex for Github sources

View Source
var VersionRegex = regexp.MustCompile("(?:\\d+\\.)*\\d+\\w*")

VersionRegex is used to parse Github version numbers

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider is the upstream provider interface for github

func (Provider) Latest

func (c Provider) Latest(name string) (r *results.Result, s results.Status)

Latest finds the newest release for a github package

func (Provider) Match

func (c Provider) Match(query string) string

Match checks to see if this provider can handle this kind of query

func (Provider) Name

func (c Provider) Name() string

Name gives the name of this provider

func (Provider) Releases

func (c Provider) Releases(name string) (rs *results.ResultSet, s results.Status)

Releases finds all matching releases for a github package

type Ref added in v1.0.4

type Ref struct {
	Object struct {
		URL string `json:"url"`
	} `json:"object"`
}

Ref is a representation of a Github Git Reference

type Refs added in v1.0.4

type Refs []Ref

Refs is a list of Refs

func (Refs) ToTags added in v1.0.4

func (rs Refs) ToTags() Tags

ToTags converts Refs to Tags

type Release

type Release struct {
	CreatedAt  string `json:"created_at"`
	Name       string `json:"name"`
	PreRelease bool   `json:"prerelease"`
	Tag        string `json:"tag_name"`
}

Release is a JSON representation fo a Github release

func (*Release) Convert

func (cr *Release) Convert(name string) *results.Result

Convert turns a Github release into a Cuppa release

type Releases

type Releases []Release

Releases is a JSON representation of one or more releases

func (*Releases) Convert

func (crs *Releases) Convert(name string) *results.ResultSet

Convert turns Github releases into a Cuppa result set

type Tag

type Tag struct {
	Tag    string `json:"tag"`
	Tagger struct {
		Date string `json:"date"`
	} `json:"tagger"`
}

Tag is a JSON representation of a Github tag

func (*Tag) Convert

func (t *Tag) Convert(name string) *results.Result

Convert turns a Github tag into a Cuppa result

type Tags

type Tags []Tag

Tags are a JSON representation of one or more tags

func (Tags) Convert

func (ts Tags) Convert(name string) *results.ResultSet

Convert a Github tagset to a Cuppa result set

func (Tags) Len added in v1.0.4

func (ts Tags) Len() int

Len gets the length of Tags

func (Tags) Less added in v1.0.4

func (ts Tags) Less(i, j int) bool

Less is used by Sort

func (Tags) Swap added in v1.0.4

func (ts Tags) Swap(i, j int)

Swap is used by Sort

Jump to

Keyboard shortcuts

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