Documentation ¶
Index ¶
- type Changelog
- type ChangelogItem
- type FilterKind
- type Git
- func (g *Git) GetCommitsBetween(from *plumbing.Reference, to *plumbing.Reference) ([]*ChangelogItem, error)
- func (g *Git) GetCommitsSince(to *plumbing.Reference) ([]*ChangelogItem, error)
- func (g *Git) GetReference(name string) (*plumbing.Reference, error)
- func (g *Git) GetRemoteCredentials(c *cli.Context) (string, string, string, error)
- type GithubAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Changelog ¶
type Changelog struct { Version string RepositoryURL string Items []*ChangelogItem }
Changelog represents the changelog
type ChangelogItem ¶
type ChangelogItem struct { Author string AuthorURL string Hash string Text string IssueID string IssueURL string ChangeType string }
ChangelogItem represents an item in the changelog
type FilterKind ¶
type FilterKind int
FilterKind describes which kind of filter should be applied on the issue's release notes
const ( FilterNone FilterKind = iota FilterReleaseNotes FilterReleaseNotesNone )
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
Git holds information about the local repository
func (*Git) GetCommitsBetween ¶
func (g *Git) GetCommitsBetween(from *plumbing.Reference, to *plumbing.Reference) ([]*ChangelogItem, error)
GetCommitsBetween return a list of ChangelogItems between two given references
func (*Git) GetCommitsSince ¶
func (g *Git) GetCommitsSince(to *plumbing.Reference) ([]*ChangelogItem, error)
GetCommitsSince return a list of ChangelogItems since a given reference
func (*Git) GetReference ¶
GetReference returns a reference for a given name (e.g. tag name, branch name, hash value or hash prefix (first 7 digits))
type GithubAPI ¶
type GithubAPI struct { User string Repository string Filter FilterKind Client *gh.Client }
GithubAPI is used to request the github api
func NewAPIClient ¶
func NewAPIClient(user string, repo string, token string, filter FilterKind) *GithubAPI
NewAPIClient returns a new client for interacting with the GitHub API
func (*GithubAPI) CompareRemote ¶
func (api *GithubAPI) CompareRemote(items []*ChangelogItem) ([]*ChangelogItem, error)
CompareRemote matches a list of ChangelogItems with the GitHub API. It will use the ChangelogItems IssueID to query the pull request. If the issue is a pull request, the values from the github response will be used to create a new ChangelogItem.