Documentation ¶
Index ¶
- type Client
- type MockGithubRepositoryService
- func (mgc *MockGithubRepositoryService) Get(ctx context.Context, owner, repo string) (*github.Repository, *github.Response, error)
- func (mgc *MockGithubRepositoryService) GetContents(ctx context.Context, owner, repo, path string, ...) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, ...)
- func (mgc *MockGithubRepositoryService) ListByOrg(ctx context.Context, org string, opts *github.RepositoryListByOrgOptions) ([]*github.Repository, *github.Response, error)
- func (mgc *MockGithubRepositoryService) ListCollaborators(ctx context.Context, owner, repo string, opts *github.ListCollaboratorsOptions) ([]*github.User, *github.Response, error)
- type MockGithubUserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Repositories repoService Users userService }
Client is a a wrapper around the GitHub client's RepositoriesService
type MockGithubRepositoryService ¶
type MockGithubRepositoryService struct { Content *github.RepositoryContent DirContent []*github.RepositoryContent Users []*github.User Response *github.Response Error error Owner string Repo string }
MockGithubRepositoryService is a struct that can replace github.RepositoriesService for testing
func (*MockGithubRepositoryService) Get ¶
func (mgc *MockGithubRepositoryService) Get(ctx context.Context, owner, repo string) (*github.Repository, *github.Response, error)
Get mocks the original github.RepositoriesService.Get() by returning the given mocked response and error
func (*MockGithubRepositoryService) GetContents ¶
func (mgc *MockGithubRepositoryService) GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
GetContents mocks the original github.RepositoriesService.GetContents() Checks whether the owner is correct and returns the mocked content, response and error
func (*MockGithubRepositoryService) ListByOrg ¶
func (mgc *MockGithubRepositoryService) ListByOrg(ctx context.Context, org string, opts *github.RepositoryListByOrgOptions) ([]*github.Repository, *github.Response, error)
ListByOrg mocks the original github.RepositoriesService.ListByOrg() Checks whether the owner is correct and returns the mocked error
func (*MockGithubRepositoryService) ListCollaborators ¶
func (mgc *MockGithubRepositoryService) ListCollaborators(ctx context.Context, owner, repo string, opts *github.ListCollaboratorsOptions) ([]*github.User, *github.Response, error)
ListCollaborators mocks the original github.RepositoriesService.ListCollaborators() Checks whether the owner is correct and returns the mocked error
type MockGithubUserService ¶
MockGithubUserService is a struct that can replace github.UsersService for testing