services

package
v0.0.0-...-af3aebc Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitHubClient

func NewGitHubClient() *github.Client

NewGitHubClient - creates a new client using the GITHUB_TOKEN (if set)

Types

type GitHubRepoID

type GitHubRepoID struct {
	Owner string
	Name  string
}

GitHubRepoID - unique identifier for a repo

func ParseRepoID

func ParseRepoID(repo string) (GitHubRepoID, error)

ParseRepoID - parses a string in the form owner/repo

type GitHubService

type GitHubService interface {
	GetRepository(repo GitHubRepoID) (*github.Repository, error)
	CreatePullRequest(newPr *NewPullRequest, repo GitHubRepoID) (*github.PullRequest, error)
	ListReleases(repo GitHubRepoID) ([]*github.RepositoryRelease, error)
}

GitHubService - service for interacting with the GitHub API

type HTTPGitHubService

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

HTTPGitHubService - concrete implementation of GitHubService

func NewGitHubService

func NewGitHubService() *HTTPGitHubService

NewGitHubService - creates a new instance of an HTTPGitHubService

func (*HTTPGitHubService) CreatePullRequest

func (service *HTTPGitHubService) CreatePullRequest(newPr *NewPullRequest, repoID GitHubRepoID) (*github.PullRequest, error)

CreatePullRequest - creates a pull request in the given repository

func (*HTTPGitHubService) GetRepository

func (service *HTTPGitHubService) GetRepository(repoID GitHubRepoID) (*github.Repository, error)

GetRepository - returns the repository for the given context

func (*HTTPGitHubService) ListReleases

func (service *HTTPGitHubService) ListReleases(repoID GitHubRepoID) ([]*github.RepositoryRelease, error)

ListReleases - list the releases in the repo

type NewPullRequest

type NewPullRequest struct {
	Title string
	Head  string
	Base  string
}

NewPullRequest - represents a new pull request

Jump to

Keyboard shortcuts

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