Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ReleaseService ¶
type RepositoryClient ¶
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.
Click to show internal directories.
Click to hide internal directories.