Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{
IssueTitleTemplate: "Update {{.Name}} to {{.LatestVersion}}",
IssueTextTemplate: "An update for `{{.Name}}` (version `{{.LatestVersion}}`) is now available. Version `{{.CurrentVersion}}` is currently in use.",
OutdatedLabel: "outdated-dependency",
}
var ErrIssueNotFound = errors.New("no such issue")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// IssueRepository is the repo to create issues in. If empty, defaults to
// GITHUB_REPOSITORY and fails if neither is set.
IssueRepository string `yaml:"issue_repository"`
// IssueTitleTemplate and IssueTextTemplate are go text/templates that will be
// used for creating the issue titles and content, respectively.
IssueTitleTemplate string `yaml:"issue_title_template"`
IssueTextTemplate string `yaml:"issue_text_template"`
// OutdatedLabel is the label to attach to created issues.
OutdatedLabel string `yaml:"outdated_label"`
// GoModules are a list of go module dependencies to check.
GoModules []GoModule `yaml:"go_modules"`
// GithubDeps are a list of github repos to check.
GithubDeps []GithubDependency `yaml:"github_repos"`
}
Config represents the tracker configuration.
func LoadConfig ¶
LoadConfig loads the Config via a file. The file is expected to be YAML.
func (*Config) SetDefaults ¶
SetDefaults applies default values to fields in the config.
func (*Config) UnmarshalYAML ¶
type Dependency ¶
Dependency is a named dependency with the current version being used and the latest version available.
type DependencyOptions ¶
type DependencyOptions struct {
// IgnoreVersionPattern is a pattern that allows you to ignore specific
// versions matching the given string.
IgnoreVersionPattern *Regexp `yaml:"ignore_version_pattern"`
}
DependencyOptions are options for individual dependencies.
type Github ¶
type Github struct {
// contains filtered or unexported fields
}
Github checks for outdated dependencies on Github projects.
func NewGithub ¶
func NewGithub(check []GithubDependency, cli *github.Client) *Github
NewGithub creates a new Github tracker.
func (*Github) CheckOutdated ¶
func (c *Github) CheckOutdated(ctx context.Context) ([]Dependency, error)
CheckOutdated will return the list of go module dependencies that can be updated.
type GithubDependency ¶
type GithubDependency struct {
Project string `yaml:"project"`
Version string `yaml:"version"`
Options DependencyOptions `yaml:",inline"`
}
GithubDependency is a dependency on a Github project.
func (*GithubDependency) UnmarshalYAML ¶
func (d *GithubDependency) UnmarshalYAML(f func(interface{}) error) error
UnmarshalYAML will unmarshal a string or an object into a GithubDependency.
type GoModule ¶
type GoModule struct {
Name string `yaml:"name"`
Options DependencyOptions `yaml:",inline"`
}
GoModule is an individual module to check.
func (*GoModule) UnmarshalYAML ¶
UnmarshalYAML unmarshals a GoModule. The value can either be a string or the GoModule struct.
type GoModules ¶
type GoModules struct {
// contains filtered or unexported fields
}
GoModules checks for outdated dependencies for Go modules.
func NewGoModules ¶
NewGoModules creates a new GoModules tracker.
func (*GoModules) CheckOutdated ¶
func (c *GoModules) CheckOutdated(ctx context.Context) ([]Dependency, error)
CheckOutdated will return the list of go module dependencies that can be updated.
type IssueCreator ¶
type IssueCreator struct {
// contains filtered or unexported fields
}
IssueCreator can create issues for a set of dependencies.
func NewIssueCreator ¶
func NewIssueCreator(c *Config, cli *github.Client) (*IssueCreator, error)
NewIssueCreator creates a new issue creator.
func (*IssueCreator) CloseOutdated ¶
func (c *IssueCreator) CloseOutdated(ctx context.Context, latest *github.Issue, dep Dependency) error
CloseOutdated closes issues for dep that are older than latest.
func (*IssueCreator) CreateIssue ¶
func (c *IssueCreator) CreateIssue(ctx context.Context, dep Dependency) (*github.Issue, error)
Create will create issues for a dep. If an issue already exists (including if it is closed), then it will not be recreated. The associated issue is returned.
func (*IssueCreator) FindIssue ¶
func (c *IssueCreator) FindIssue(ctx context.Context, dep Dependency) (*github.Issue, error)
FindIssue looks for an existing issue associated with a dependency.
type Multi ¶
type Multi struct {
// contains filtered or unexported fields
}
Multi combines multiple trackers.
func (*Multi) CheckOutdated ¶
func (m *Multi) CheckOutdated(ctx context.Context) ([]Dependency, error)
CheckOutdated calls CheckOutdated for each tracker in the list.
type Regexp ¶
Regexp is a regex that can be unmarshaled from a string.