github

package
v0.1.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Label

type Label struct {
	ID    int64  `yaml:",omitempty"`
	Name  string `yaml:",omitempty"`
	Color string `yaml:",omitempty"`
	Desc  string `yaml:",omitempty"`
}

Label represents a GitHub label.

func (*Label) Apply

func (label *Label) Apply(diff LabelPatch)

Apply modifies the Label with data from the diff.

func (Label) IsChanged

func (label Label) IsChanged(state Label) bool

IsChanged returns true if a Label should be updated.

func (Label) IsEmpty

func (label Label) IsEmpty() bool

IsEmpty returns true if a Label should be deleted.

func (Label) IsNew

func (label Label) IsNew() bool

IsNew returns true if a Label should be created.

type LabelPatch

type LabelPatch struct {
	Label `yaml:",inline"`
	From  []Label `yaml:",omitempty"`
}

LabelPatch represents a preset Label.

func (LabelPatch) Match

func (patch LabelPatch) Match(with Label) int

Match calculates score from comparing with Label.

type LabelPreset

type LabelPreset struct {
	Name   string
	Labels []LabelPatch `yaml:",omitempty"`
}

LabelPreset represents a specific set of labels.

func (*LabelPreset) ExtractMatched

func (set *LabelPreset) ExtractMatched(target Label) LabelPatch

ExtractMatched founds the most appropriate LabelPatch for the specified Label.

type LabelSet

type LabelSet struct {
	Name   string
	Labels []Label `yaml:",omitempty"`
}

LabelSet represents a GitHub repository set of labels.

func (LabelSet) FindByID

func (set LabelSet) FindByID(id int64) *Label

FindByID finds a Label by id or returns nil.

func (LabelSet) Len

func (set LabelSet) Len() int

func (LabelSet) Less

func (set LabelSet) Less(i, j int) bool

func (LabelSet) Swap

func (set LabelSet) Swap(i, j int)

type Remote

type Remote git.Remote

Remote represents a connection to a remote GitHub repository.

func (Remote) ID

func (remote Remote) ID() string

ID returns "{owner}/{repo}" as a remote identifier.

func (Remote) OwnerAndName

func (remote Remote) OwnerAndName() (string, string)

OwnerAndName returns an owner and repository name.

type Repository

type Repository struct {
	Remote
	ID     int64
	Labels []Label
}

Repository represents a GitHub repository.

type SortLabelsByName

type SortLabelsByName LabelSet

SortLabelsByName allows to sort labels by name instead of ID by default.

func (SortLabelsByName) Len

func (set SortLabelsByName) Len() int

func (SortLabelsByName) Less

func (set SortLabelsByName) Less(i, j int) bool

func (SortLabelsByName) Swap

func (set SortLabelsByName) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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