model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

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

func (Comments) Ptr

func (c Comments) Ptr() *Comments

Ptr gets the pointer to a Comments object

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

func (Enable) Ptr

func (e Enable) Ptr() *Enable

Ptr gets the pointer to an Enable object

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

func (Label) Ptr

func (l Label) Ptr() *Label

Ptr gets the pointer to a Label object

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

Jump to

Keyboard shortcuts

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