settings

package
v0.0.0-...-8fb4044 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func FilterIncludesIssues(filters []*Filter) bool

FilterIncludesIssues is a predicate to determine whether or not a set of filters should include issues.

func FilterIncludesPullRequests

func FilterIncludesPullRequests(filters []*Filter) bool

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

func (f AgeFilter) ApplyIssue(context operations.Context, issue *github.Issue) bool

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.

func (AgeFilter) String

func (f AgeFilter) String() string

String returns a string representation of the filter

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

type ExtDuration struct {
	Quantity int64
	Unit     rune
}

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

type Filter struct {
	Strategy fmt.Stringer
}

Filter accepts or rejects a GitHub item based on a strategy.

func MakeFilter

func MakeFilter(filterType, value string) (*Filter, error)

MakeFilter creates a filter from a type identifier and a string value.

func ParseCliFilters

func ParseCliFilters(c *cli.Context) ([]*Filter, error)

ParseCliFilters reads filter definitions from the command line.

func (*Filter) Apply

func (f *Filter) Apply(context operations.Context, item gh.Item) bool

Apply returns whether the internal strategy is accepting or rejecting the specified GitHub item.

type Filters

type Filters []*Filter

Filters is a collection of Filter instances.

func ParseConfigurationFilters

func ParseConfigurationFilters(values map[string]interface{}) (Filters, error)

ParseConfigurationFilters reads filter definitions from the serialized configuration format.

func (Filters) Apply

func (f Filters) Apply(context operations.Context, item gh.Item) bool

Apply returns true only if all filters accept the item.

type IsFilter

type IsFilter struct {
	PullRequestOnly bool
}

IsFilter filters issues and pull requests based on their type.

func (IsFilter) ApplyIssue

func (f IsFilter) ApplyIssue(context operations.Context, issue *github.Issue) bool

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.

func (IsFilter) String

func (f IsFilter) String() string

String returns a string representation of the filter

type MultiValuedKeys

type MultiValuedKeys map[string][]string

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

Jump to

Keyboard shortcuts

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