github

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package github is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

type GitHub interface {
	GetOwner() string
	GetLatestRelease(repo string) (*goGithub.RepositoryRelease, error)
	CreateBranch(repo, origin, new string) error
	DeleteLatestRef(repo, branch string) error
	CreatePullRequest(repo, title, head, base, body string) (*goGithub.PullRequest, error)
	MergePullRequest(repo string, number int) error
	ClosePullRequest(repo string, number int) error
	GetFile(repo, branch, path string) (*goGithub.RepositoryContent, error)
	CreateFile(repo, branch, path, message string, content []byte) (*goGithub.RepositoryContentResponse, error)
	UpdateFile(repo, branch, path, sha, message string, content []byte) error
	DeleteFile(repo, branch, path, sha, message string) error
	CreateRepository(name, description, homepage string, private bool) error
	DeleteRepository(name string) error
}

GitHub defines functions to interact with GitHub API

func NewGitHubClient

func NewGitHubClient(owner, token string) (GitHub, error)

NewGitHubClient creates and initializes a new GitHubClient

type GitHubClient

type GitHubClient struct {
	Owner  string
	Client *goGithub.Client
}

GitHubClient is a clint to interact with Github API

func (*GitHubClient) ClosePullRequest

func (g *GitHubClient) ClosePullRequest(repo string, number int) error

ClosePullRequest closes Pull Request with a give Pull Request number

func (*GitHubClient) CreateBranch

func (g *GitHubClient) CreateBranch(repo, origin, new string) error

CreateNewBranch creates a new branch from the heads of the origin

func (*GitHubClient) CreateFile

func (g *GitHubClient) CreateFile(repo, branch, path, message string, content []byte) (*goGithub.RepositoryContentResponse, error)

CreateFile create a file with a given content on GitHub

func (*GitHubClient) CreatePullRequest

func (g *GitHubClient) CreatePullRequest(repo, title, head, base, body string) (*goGithub.PullRequest, error)

CreatePullRequest creates Pull Request

func (*GitHubClient) CreateRepository

func (g *GitHubClient) CreateRepository(name, description, homepage string, private bool) error

CreateRepository creates a new GitHub repository

func (*GitHubClient) DeleteFile

func (g *GitHubClient) DeleteFile(repo, branch, path, sha, message string) error

DeleteFile deletes a file on GitHub

func (*GitHubClient) DeleteLatestRef

func (g *GitHubClient) DeleteLatestRef(repo, branch string) error

DeleteLatestRef deletes the latest Ref of the given branch, intended to be used for rollbacks

func (*GitHubClient) DeleteRepository

func (g *GitHubClient) DeleteRepository(name string) error

DeleteRepository deletes a GitHub repository

func (*GitHubClient) GetFile

func (g *GitHubClient) GetFile(repo, branch, path string) (*goGithub.RepositoryContent, error)

GetFile gets the specified file on GitHub

func (*GitHubClient) GetLatestRelease

func (g *GitHubClient) GetLatestRelease(repo string) (*goGithub.RepositoryRelease, error)

GetCurrentRelease returns the latest release of the given Repository

func (*GitHubClient) GetOwner

func (g *GitHubClient) GetOwner() string

GetOwner returns the repository owner name

func (*GitHubClient) MergePullRequest

func (g *GitHubClient) MergePullRequest(repo string, number int) error

MergePullRequest merges Pull Request with a give Pull Request number

func (*GitHubClient) UpdateFile

func (g *GitHubClient) UpdateFile(repo, branch, path, sha, message string, content []byte) error

UpdateFile updates a file on GitHub with a given content

type MockGitHub

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

MockGitHub is a mock of GitHub interface

func NewMockGitHub

func NewMockGitHub(ctrl *gomock.Controller) *MockGitHub

NewMockGitHub creates a new mock instance

func (*MockGitHub) ClosePullRequest

func (m *MockGitHub) ClosePullRequest(repo string, number int) error

ClosePullRequest mocks base method

func (*MockGitHub) CreateBranch

func (m *MockGitHub) CreateBranch(repo, origin, new string) error

CreateBranch mocks base method

func (*MockGitHub) CreateFile

func (m *MockGitHub) CreateFile(repo, branch, path, message string, content []byte) (*github.RepositoryContentResponse, error)

CreateFile mocks base method

func (*MockGitHub) CreatePullRequest

func (m *MockGitHub) CreatePullRequest(repo, title, head, base, body string) (*github.PullRequest, error)

CreatePullRequest mocks base method

func (*MockGitHub) CreateRepository

func (m *MockGitHub) CreateRepository(name, description, homepage string, private bool) error

CreateRepository mocks base method

func (*MockGitHub) DeleteFile

func (m *MockGitHub) DeleteFile(repo, branch, path, sha, message string) error

DeleteFile mocks base method

func (*MockGitHub) DeleteLatestRef

func (m *MockGitHub) DeleteLatestRef(repo, branch string) error

DeleteLatestRef mocks base method

func (*MockGitHub) DeleteRepository

func (m *MockGitHub) DeleteRepository(name string) error

DeleteRepository mocks base method

func (*MockGitHub) EXPECT

func (m *MockGitHub) EXPECT() *MockGitHubMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockGitHub) GetFile

func (m *MockGitHub) GetFile(repo, branch, path string) (*github.RepositoryContent, error)

GetFile mocks base method

func (*MockGitHub) GetLatestRelease

func (m *MockGitHub) GetLatestRelease(repo string) (*github.RepositoryRelease, error)

GetLatestRelease mocks base method

func (*MockGitHub) GetOwner

func (m *MockGitHub) GetOwner() string

GetOwner mocks base method

func (*MockGitHub) MergePullRequest

func (m *MockGitHub) MergePullRequest(repo string, number int) error

MergePullRequest mocks base method

func (*MockGitHub) UpdateFile

func (m *MockGitHub) UpdateFile(repo, branch, path, sha, message string, content []byte) error

UpdateFile mocks base method

type MockGitHubMockRecorder

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

MockGitHubMockRecorder is the mock recorder for MockGitHub

func (*MockGitHubMockRecorder) ClosePullRequest

func (mr *MockGitHubMockRecorder) ClosePullRequest(repo, number interface{}) *gomock.Call

ClosePullRequest indicates an expected call of ClosePullRequest

func (*MockGitHubMockRecorder) CreateBranch

func (mr *MockGitHubMockRecorder) CreateBranch(repo, origin, new interface{}) *gomock.Call

CreateBranch indicates an expected call of CreateBranch

func (*MockGitHubMockRecorder) CreateFile

func (mr *MockGitHubMockRecorder) CreateFile(repo, branch, path, message, content interface{}) *gomock.Call

CreateFile indicates an expected call of CreateFile

func (*MockGitHubMockRecorder) CreatePullRequest

func (mr *MockGitHubMockRecorder) CreatePullRequest(repo, title, head, base, body interface{}) *gomock.Call

CreatePullRequest indicates an expected call of CreatePullRequest

func (*MockGitHubMockRecorder) CreateRepository

func (mr *MockGitHubMockRecorder) CreateRepository(name, description, homepage, private interface{}) *gomock.Call

CreateRepository indicates an expected call of CreateRepository

func (*MockGitHubMockRecorder) DeleteFile

func (mr *MockGitHubMockRecorder) DeleteFile(repo, branch, path, sha, message interface{}) *gomock.Call

DeleteFile indicates an expected call of DeleteFile

func (*MockGitHubMockRecorder) DeleteLatestRef

func (mr *MockGitHubMockRecorder) DeleteLatestRef(repo, branch interface{}) *gomock.Call

DeleteLatestRef indicates an expected call of DeleteLatestRef

func (*MockGitHubMockRecorder) DeleteRepository

func (mr *MockGitHubMockRecorder) DeleteRepository(name interface{}) *gomock.Call

DeleteRepository indicates an expected call of DeleteRepository

func (*MockGitHubMockRecorder) GetFile

func (mr *MockGitHubMockRecorder) GetFile(repo, branch, path interface{}) *gomock.Call

GetFile indicates an expected call of GetFile

func (*MockGitHubMockRecorder) GetLatestRelease

func (mr *MockGitHubMockRecorder) GetLatestRelease(repo interface{}) *gomock.Call

GetLatestRelease indicates an expected call of GetLatestRelease

func (*MockGitHubMockRecorder) GetOwner

func (mr *MockGitHubMockRecorder) GetOwner() *gomock.Call

GetOwner indicates an expected call of GetOwner

func (*MockGitHubMockRecorder) MergePullRequest

func (mr *MockGitHubMockRecorder) MergePullRequest(repo, number interface{}) *gomock.Call

MergePullRequest indicates an expected call of MergePullRequest

func (*MockGitHubMockRecorder) UpdateFile

func (mr *MockGitHubMockRecorder) UpdateFile(repo, branch, path, sha, message, content interface{}) *gomock.Call

UpdateFile indicates an expected call of UpdateFile

Jump to

Keyboard shortcuts

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