release

package
v0.0.0-...-6cf080c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changeset

type Changeset struct {
}

type GithubAPIClient

type GithubAPIClient interface {
	CreateRelease(context.Context, string, string, *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
	GetLatestRelease(context.Context, string, string) (*github.RepositoryRelease, *github.Response, error)
}

Declares go-github's interface so we can provide fake implementations in tests.

type GithubClient

type GithubClient struct {
	APIClient GithubAPIClient
	Search    SearchAPI
	// contains filtered or unexported fields
}

Wraps go-github in a public API of our own declouping Sigbot's services from go-github's design decisions. It provides methods that better suit our needs.

func NewGithubClient

func NewGithubClient(owner, repo string) *GithubClient

func (*GithubClient) DraftRelease

func (g *GithubClient) DraftRelease(r Release) (Release, error)

Creates a new Github release in draft state

func (*GithubClient) GetLatestRelease

func (g *GithubClient) GetLatestRelease() (Release, error)

Returns the last release present in Github

func (*GithubClient) GetPullRequestsSince

func (g *GithubClient) GetPullRequestsSince(date time.Time) ([]PullRequest, error)

type GithubReleaseService

type GithubReleaseService struct {
	Client RepositoryClient
}

func NewGithubReleaseService

func NewGithubReleaseService() *GithubReleaseService

func (*GithubReleaseService) CreateRelease

func (g *GithubReleaseService) CreateRelease(r Release) (Release, error)

TODO: I think r should be a pointer to a Release and then we could complete the empty fields with the data returned by Github. I don't don't what benefits it'd bring other than less memory usage.

type PullRequest

type PullRequest struct {
	Number int
	URL    string
	Title  string
}

type Release

type Release struct {
	URL         string
	TagName     string
	CodeName    string
	Description string
	PublishedAt github.Timestamp
	Committish  string
}

type ReleaseService

type ReleaseService interface {
	CreateRelease(Release) Release
}

type RepositoryClient

type RepositoryClient interface {
	DraftRelease(Release) (Release, error)
	GetLatestRelease() (Release, error)
	GetPullRequestsSince(time.Time) ([]PullRequest, error)
}

type SearchAPI

type SearchAPI interface {
	Issues(context.Context, string, *github.SearchOptions) (*github.IssuesSearchResult, *github.Response, error)
}

Defines go-github's Search interface so we can provide fake implementations in tests.

type Version

type Version struct {
	// contains filtered or unexported fields
}

func NewVersion

func NewVersion(number string) *Version

func (*Version) NextMinor

func (v *Version) NextMinor() string

TODO: add prefix string in struct so NextMinor becomes simpler. No need for conditionals; simply prepend the computed nextVersion with the prefix.

Jump to

Keyboard shortcuts

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