settings

package
v0.0.0-...-ddb4624 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: Apache-2.0 Imports: 8 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

This section is empty.

Types

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(issue *github.Issue) bool

ApplyIssue applies the filter to the specified issue.

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(issue *github.Issue) bool

ApplyIssue applies the filter to the specified issue.

func (CommentsFilter) ApplyPullRequest

func (f CommentsFilter) ApplyPullRequest(pullRequest *github.PullRequest) bool

ApplyPullRequest applies the filter to the specified pull request.

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 interface{}
}

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(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(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(issue *github.Issue) bool

ApplyIssue applies the filter to the specified issue.

func (IsFilter) ApplyPullRequest

func (f IsFilter) ApplyPullRequest(pullRequest *github.PullRequest) bool

ApplyPullRequest applies the filter to the specified pull request.

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(issue *github.Issue) bool

ApplyIssue applies the filter to the specified issue.

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(issue *github.Issue) bool

ApplyIssue applies the filter to the specified issue.

Jump to

Keyboard shortcuts

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