Documentation
¶
Index ¶
- Constants
- Variables
- type Provider
- func (c Provider) GetReleases(name string, max int) (rs *results.ResultSet, err error)
- func (c Provider) Latest(params []string) (r *results.Result, err error)
- func (c Provider) Match(query string) (params []string)
- func (c Provider) Releases(params []string) (rs *results.ResultSet, err error)
- func (c Provider) String() string
- type RepoQuery
- type RepoQueryResult
Constants ¶
View Source
const GraphQLAPI = "https://api.github.com/graphql"
GraphQLAPI is the location of the GraphQL Endpoint
View Source
const RepoQueryFormat = `` /* 677-byte string literal not displayed */
RepoQueryFormat is the text format for the necessary GraphQL query
View Source
const (
// SourceFormat is the format string for Github release tarballs
SourceFormat = "https://github.com/%s/archive/%s.tar.gz"
)
Variables ¶
View Source
var ( // SourceRegex is the regex for Github sources SourceRegex = regexp.MustCompile("github.com/([^/]+/[^/.]+)") // VersionRegex is used to parse Github version numbers VersionRegex = regexp.MustCompile("(?:\\d+\\.)*\\d+\\w*") )
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct{}
Provider is the upstream provider interface for github
func (Provider) GetReleases ¶
GetReleases gets a number of releases for a given repo
type RepoQuery ¶
type RepoQuery struct {
Query string `json:"query"`
}
RepoQuery is the JSON payload for this request
type RepoQueryResult ¶
type RepoQueryResult struct {
Data struct {
Repository struct {
Releases struct {
Nodes []struct {
Name string `json:"name"`
PublishedAt string `json:"publishedAt"`
IsPrerelease bool `json:"isPrerelease"`
Tag struct {
Name string `json:"name"`
} `json:"tag"`
} `json:"nodes"`
} `json:"releases"`
Refs struct {
Nodes []struct {
Name string `json:"name"`
Target struct {
Date string `json:"committedDate"`
Tagger struct {
Date string `json:"date"`
} `json:"tagger"`
} `json:"target"`
} `json:"nodes"`
} `json:"refs"`
} `json:"repository"`
} `json:"data"`
}
RepoQueryResult is the JSON payload of the response
Click to show internal directories.
Click to hide internal directories.