Documentation
¶
Overview ¶
Package github provides a github-based lookup type.
Package github provides a github-based lookup type.
Package github provides a github-based lookup type.
Package github provides a github-based lookup type.
Package github provides a github-based lookup type.
Package github provides a github-based lookup type.
Package github provides a github-based lookup type.
Package github provides a github-based lookup type.
Index ¶
- func SetEmptyListETag(accessToken string)
- type Data
- func (g *Data) Copy() *Data
- func (g *Data) CopyFrom(from *Data)
- func (g *Data) ETag() string
- func (g *Data) Releases() []github_types.Release
- func (g *Data) SetETag(etag string)
- func (g *Data) SetReleases(releases []github_types.Release)
- func (g *Data) SetTagFallback()
- func (g *Data) String() string
- func (g *Data) TagFallback() bool
- type Lookup
- func (l *Lookup) CheckValues(prefix string) error
- func (l *Lookup) GetGitHubData() *Data
- func (l *Lookup) Inherit(fromLookup base.Interface)
- func (l *Lookup) Init(options *opt.Options, status *status.Status, ...)
- func (l *Lookup) Query(metrics bool, logFrom logutil.LogFrom) (bool, error)
- func (l *Lookup) ServiceURL(ignoreWebURL bool) (serviceURL string)
- func (l *Lookup) UnmarshalJSON(data []byte) error
- func (l *Lookup) UnmarshalYAML(value *yaml.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetEmptyListETag ¶
func SetEmptyListETag(accessToken string)
SetEmptyListETag finds the ETag for an empty list query on the GitHub API and sets it to be used as the initial ETag for Data.
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data contains the information used and retrieved during GitHub requests, including the eTag, associated releases, and the usage state of the "/tags" endpoint.
func (*Data) Releases ¶
func (g *Data) Releases() []github_types.Release
Releases stored in the Data.
func (*Data) SetReleases ¶
func (g *Data) SetReleases(releases []github_types.Release)
SetReleases of the Data.
func (*Data) SetTagFallback ¶
func (g *Data) SetTagFallback()
SetTagFallback will flip the TagFallback bool.
type Lookup ¶
type Lookup struct { base.Lookup `yaml:",inline" json:",inline"` // Base struct for a Lookup. AccessToken string `yaml:"access_token,omitempty" json:"access_token,omitempty"` // GitHub access token to use. UsePreRelease *bool `yaml:"use_prerelease,omitempty" json:"use_prerelease,omitempty"` // Whether releases with the prerelease tag should be considered. // contains filtered or unexported fields }
Lookup provides a GitHub-based lookup type.
func New ¶
func New( configFormat string, configData interface{}, options *opt.Options, status *status.Status, defaults, hardDefaults *base.Defaults, ) (*Lookup, error)
New returns a new Lookup from a string in a given format (json/yaml).
func (*Lookup) CheckValues ¶
CheckValues validates the fields of the Lookup struct.
func (*Lookup) GetGitHubData ¶
GetGitHubData will return the GitHub data. (For tests).
func (*Lookup) Inherit ¶
Inherit values from `fromLookup` if the values should query the same source.
Values: githubData, Require.
func (*Lookup) Init ¶
func (l *Lookup) Init( options *opt.Options, status *status.Status, defaults, hardDefaults *base.Defaults, )
Init the Lookup, assigning Defaults, and initialising child structs.
func (*Lookup) Query ¶
Query queries the source, and returns whether a new release was found, and updates LatestVersion if so.
Parameters:
- metrics: if true, set Prometheus metrics based on the query.
func (*Lookup) ServiceURL ¶
ServiceURL translates possible `owner/repo` URLs, adding the github.com/ prefix.
func (*Lookup) UnmarshalJSON ¶
UnmarshalJSON will unmarshal the Lookup.
func (*Lookup) UnmarshalYAML ¶
UnmarshalYAML will unmarshal the Lookup.