Documentation
¶
Overview ¶
Package labeler provides a utility for labeling GitHub issues and pull requests based on configurable rules and field evaluation.
Index ¶
- type FieldFlag
- type Labeler
- type Opt
- type OptFn
- func WithClient(client *github.Client) OptFn
- func WithConfigPath(value string) OptFn
- func WithContext(ctx context.Context) OptFn
- func WithData(value string) OptFn
- func WithEvent(value string) OptFn
- func WithFields(fieldFlag FieldFlag) OptFn
- func WithID(value int) OptFn
- func WithOwner(value string) OptFn
- func WithRepo(value string) OptFn
- func WithToken(value string) OptFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldFlag ¶ added in v0.1.2
type FieldFlag uint
FieldFlag represents a bitmask for fields that can be evaluated for labeling. Use bitwise operations or helper methods to combine and check flags.
const ( // FieldTitle indicates the title field should be evaluated for labeling. FieldTitle FieldFlag = 1 << iota // FieldBody indicates the body field should be evaluated for labeling. FieldBody // AllFieldFlags is a convenience constant representing all available fields. AllFieldFlags = FieldTitle | FieldBody )
func ParseFieldFlags ¶ added in v0.1.2
ParseFieldFlags converts a slice of string field names to a FieldFlag bitmask. Unrecognized field names are ignored.
type Labeler ¶
type Labeler struct {
Owner *string
Repo *string
Event *string
Data *string
ID *int
// contains filtered or unexported fields
}
Labeler is the container for the application entrypoint's logic
func NewWithOptions ¶ added in v0.1.0
NewWithOptions constructs a new Labeler with functional arguments of type OptFn
type Opt ¶ added in v0.1.0
type Opt struct {
// contains filtered or unexported fields
}
Opt is a group of options for constructing a new Labeler
type OptFn ¶ added in v0.1.0
type OptFn func(o *Opt)
func WithClient ¶ added in v0.1.0
WithClient allows for configuration of the github client
func WithConfigPath ¶ added in v0.1.0
WithConfigPath allows for configuring the labeler config path relative to the repository root (usually .github/labeler.yml)
func WithContext ¶ added in v0.1.0
WithContext allows configuration of the context used as a parent context for all GitHub API calls
func WithData ¶ added in v0.1.0
WithData allows for configuring the JSON event data to apply a label
func WithFields ¶ added in v0.1.2
WithFields allows for configuring the fields to evaluate for labeling
func WithID ¶ added in v0.1.0
WithID allows for configuring the identifier of the issue or pull request we want to label
func WithOwner ¶ added in v0.1.0
WithOwner allows for configuring the user or organization owning the target repo