service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanTitle added in v1.0.0

func CleanTitle(s string) string

CleanTitle returns the string with spaces trimmed and the first rune title-cased

Types

type Contributor

type Contributor struct {
	Name    string
	Profile string
}

Contributor is a project contributor

type ContributorList

type ContributorList []Contributor

ContributorList is a slice of Contributors that can be sorted

func (ContributorList) Len

func (cl ContributorList) Len() int

Len is the length of the ContributorList

func (ContributorList) Less

func (cl ContributorList) Less(i, j int) bool

Less determines whether a Contributor comes before another Contributor

func (ContributorList) Swap

func (cl ContributorList) Swap(i, j int)

Swap swaps Contributors in a ContributorList

type Entry added in v0.2.0

type Entry struct {
	Title  string
	Index  int64
	Labels []Label
}

Entry is the minimum information needed to make a changelog entry

type GitHub

type GitHub struct {
	Milestone string
	GitTag    string
	Token     string
	Repo      string
	Issues    bool
}

GitHub defines a GitHub service

func (*GitHub) Contributors

func (gh *GitHub) Contributors() (ContributorList, error)

Contributors returns a list of contributors from GitHub

func (*GitHub) Generate

func (gh *GitHub) Generate() (string, []Entry, error)

Generate returns a GitHub changelog

type Gitea

type Gitea struct {
	Milestone string
	GitTag    string
	Token     string
	BaseURL   string
	Owner     string
	Repo      string
	Issues    bool
}

Gitea defines a Gitea service

func (*Gitea) Contributors

func (ge *Gitea) Contributors() (ContributorList, error)

Contributors returns a list of contributors from Gitea

func (*Gitea) Generate

func (ge *Gitea) Generate() (string, []Entry, error)

Generate returns a Gitea changelog

type Label

type Label struct {
	Name string
}

Label is the minimum information needed for a PR label

type Service

type Service interface {
	Generate() (string, []Entry, error)
	Contributors() (ContributorList, error)
}

Service defines how a struct can be a Changelog Service

func New

func New(serviceType, repo, baseURL, milestone, tag, token string, issues bool) (Service, error)

New returns a service from a string

Jump to

Keyboard shortcuts

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