Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comments ¶
type Comments struct {
Issues *string `yaml:"issues,omitempty"`
PullRequests *string `yaml:"prs,omitempty"`
}
Comments are optional comment text to be added to the issue or pull request when labels are applied
type Config ¶
type Config interface {
// FromBytes is used to parse bytes into the Config instance
FromBytes(b []byte) error
// LabelsFor allows config implementations to determine the labels to be applied to the input strings
LabelsFor(text ...string) []string
}
Config is the interface used by simple and full config objects
type Enable ¶
type Enable struct {
Issues *bool `yaml:"issues,omitempty"`
PullRequests *bool `yaml:"prs,omitempty"`
}
Enable is a structure to hold options around enabling the labeler
type FullConfig ¶
type FullConfig struct {
Enable *Enable `yaml:"enable,omitempty"`
Comments *Comments `yaml:"comments,omitempty"`
Labels map[string]Label `yaml:"labels,flow"`
}
FullConfig is the container defining how the configuration object is structured
func (*FullConfig) FromBytes ¶
func (f *FullConfig) FromBytes(b []byte) error
FromBytes is used to parse bytes into the Config instance
func (*FullConfig) LabelsFor ¶
func (f *FullConfig) LabelsFor(text ...string) []string
LabelsFor allows config implementations to determine the labels to be applied to the input strings
func (FullConfig) Ptr ¶
func (f FullConfig) Ptr() *FullConfig
Ptr gets the pointer to a FullConfig object
type Label ¶
type Label struct {
Include []string `yaml:"include,omitempty,flow"`
Exclude []string `yaml:"exclude,omitempty,flow"`
}
Label holds the rules around how labels will be applied
type SimpleConfig ¶
type SimpleConfig struct {
// Comment will be applied to any issue or pull request matching the target labels
Comment string `yaml:"comment,omitempty"`
// Labels are keyed by the label to be applied, and valued by the array of regular expression patterns to match before applying
Labels map[string][]string `yaml:"labels,omitempty,flow"`
}
SimpleConfig is the simplest supported config structure. See FullConfig for more functionality.
func (*SimpleConfig) FromBytes ¶
func (s *SimpleConfig) FromBytes(b []byte) error
FromBytes parses the bytes into the SimpleConfig object
func (*SimpleConfig) LabelsFor ¶
func (s *SimpleConfig) LabelsFor(text ...string) []string
LabelsFor allows config implementations to determine the labels to be applied to the input strings