github

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2018 License: Apache-2.0 Imports: 8 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/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 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 {
	Name string `json:"name"`
}

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

Jump to

Keyboard shortcuts

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