Documentation ¶
Index ¶
- Variables
- func FilterIncludesIssues(filters []*Filter) bool
- func FilterIncludesPullRequests(filters []*Filter) bool
- type AgeFilter
- type AssignedFilter
- type CommentsFilter
- type ContainsFilter
- type ExtDuration
- type Filter
- type Filters
- type IsFilter
- type MultiValuedKeys
- type WithLabelsFilter
- type WithoutLabelsFilter
Constants ¶
This section is empty.
Variables ¶
var FilteringFlag = cli.StringSliceFlag{
Name: filterFlagName,
Usage: "filter based on item attributes",
}
FilteringFlag is the command-line flag that gets automatically added to every available operation.
Functions ¶
func FilterIncludesIssues ¶
FilterIncludesIssues is a predicate to determine whether or not a set of filters should include issues.
func FilterIncludesPullRequests ¶
FilterIncludesPullRequests is similar to FilterIncludesIssues only with respect to pull requests.
Types ¶
type AgeFilter ¶
type AgeFilter struct {
// contains filtered or unexported fields
}
AgeFilter filters items based on their age.
func (AgeFilter) ApplyIssue ¶
ApplyIssue applies the filter to the specified issue.
func (AgeFilter) ApplyPullRequest ¶
func (f AgeFilter) ApplyPullRequest(context operations.Context, pullRequest *github.PullRequest) bool
ApplyPullRequest applies the filter to the specified pull request.
type AssignedFilter ¶
type AssignedFilter struct {
// contains filtered or unexported fields
}
AssignedFilter filters issues based on whether they are assigned or not.
func (AssignedFilter) ApplyIssue ¶
func (f AssignedFilter) ApplyIssue(context operations.Context, issue *github.Issue) bool
ApplyIssue applies the filter to the specified issue.
func (AssignedFilter) String ¶
func (f AssignedFilter) String() string
String returns a string representation of the filter
type CommentsFilter ¶
type CommentsFilter struct {
// contains filtered or unexported fields
}
CommentsFilter filters issues based on the number of comments.
func (CommentsFilter) ApplyIssue ¶
func (f CommentsFilter) ApplyIssue(context operations.Context, issue *github.Issue) bool
ApplyIssue applies the filter to the specified issue.
func (CommentsFilter) ApplyPullRequest ¶
func (f CommentsFilter) ApplyPullRequest(context operations.Context, pullRequest *github.PullRequest) bool
ApplyPullRequest applies the filter to the specified pull request.
func (CommentsFilter) String ¶
func (f CommentsFilter) String() string
String returns a string representation of the filter
type ContainsFilter ¶
type ContainsFilter struct {
// contains filtered or unexported fields
}
ContainsFilter implements a filter for regexps that checks comments.
func (ContainsFilter) ApplyIssue ¶
func (f ContainsFilter) ApplyIssue(context operations.Context, issue *github.Issue) bool
ApplyIssue applies the filter to the specified issue.
func (ContainsFilter) ApplyPullRequest ¶
func (f ContainsFilter) ApplyPullRequest(context operations.Context, pullRequest *github.PullRequest) bool
ApplyPullRequest applies the filter to the specified pull request.
func (ContainsFilter) String ¶
func (f ContainsFilter) String() string
String returns a string representation of the filter
type ExtDuration ¶
ExtDuration is an extension of time.Duration to support units longer than hours.
func ParseExtDuration ¶
func ParseExtDuration(value string) (ExtDuration, error)
ParseExtDuration parses an ExtDuration from a string.
func (ExtDuration) Duration ¶
func (e ExtDuration) Duration() time.Duration
Duration returns the value as a time.Duration.
func (ExtDuration) String ¶
func (e ExtDuration) String() string
String returns a string representation of the ExtDuration.
type Filter ¶
Filter accepts or rejects a GitHub item based on a strategy.
func MakeFilter ¶
MakeFilter creates a filter from a type identifier and a string value.
func ParseCliFilters ¶
ParseCliFilters reads filter definitions from the command line.
type Filters ¶
type Filters []*Filter
Filters is a collection of Filter instances.
func ParseConfigurationFilters ¶
ParseConfigurationFilters reads filter definitions from the serialized configuration format.
type IsFilter ¶
type IsFilter struct {
PullRequestOnly bool
}
IsFilter filters issues and pull requests based on their type.
func (IsFilter) ApplyIssue ¶
ApplyIssue applies the filter to the specified issue.
func (IsFilter) ApplyPullRequest ¶
func (f IsFilter) ApplyPullRequest(context operations.Context, pullRequest *github.PullRequest) bool
ApplyPullRequest applies the filter to the specified pull request.
type MultiValuedKeys ¶
MultiValuedKeys represents a dictionary where each key can have multiple values. This is represented:
In the CLI using a StringSliceFlag such as: `--param key=val1,val2,val3`
In the configuration file using a dictionary of lists, such as `param: { key: [ val1, val2, val3 ] }`
func NewMultiValuedKeys ¶
func NewMultiValuedKeys() MultiValuedKeys
NewMultiValuedKeys returns an empty MultiValuedKeys.
func NewMultiValuedKeysFromSlice ¶
func NewMultiValuedKeysFromSlice(collection []string) (MultiValuedKeys, error)
NewMultiValuedKeysFromSlice reads a MultiValuedKeys from a collection of formatted strings, as typically provided through the command line.
func (MultiValuedKeys) ForEach ¶
func (m MultiValuedKeys) ForEach(fn func(key, value string) error) error
ForEach calls the provided `fn` function for each key-value pair.
func (MultiValuedKeys) ToSerializedFormat ¶
func (m MultiValuedKeys) ToSerializedFormat() map[string]interface{}
ToSerializedFormat transforms a MultiValuedKeys into its serialized representation, where single values are represented by a string rather than a slice of length 1.
type WithLabelsFilter ¶
type WithLabelsFilter struct {
// contains filtered or unexported fields
}
WithLabelsFilter filters issues based on whether they bear all of the specified labels.
func (WithLabelsFilter) ApplyIssue ¶
func (f WithLabelsFilter) ApplyIssue(context operations.Context, issue *github.Issue) bool
ApplyIssue applies the filter to the specified issue.
func (WithLabelsFilter) String ¶
func (f WithLabelsFilter) String() string
String returns a string representation of the filter
type WithoutLabelsFilter ¶
type WithoutLabelsFilter struct {
// contains filtered or unexported fields
}
WithoutLabelsFilter filters issues based on whether they bear none of the specified labels.
func (WithoutLabelsFilter) ApplyIssue ¶
func (f WithoutLabelsFilter) ApplyIssue(context operations.Context, issue *github.Issue) bool
ApplyIssue applies the filter to the specified issue.
func (WithoutLabelsFilter) String ¶
func (f WithoutLabelsFilter) String() string
String returns a string representation of the filter