Documentation ¶
Overview ¶
Package githubclient contains methods for interacting with git
Package githubclient contains methods for interacting with git
Index ¶
- type GitClient
- func (gitClient *GitClient) GetRepositoryContents(log log.T, owner, repo, path string, opt *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, ...)
- func (gitClient *GitClient) IsFileContentType(file *github.RepositoryContent) bool
- func (gitClient *GitClient) ParseGetOptions(log log.T, getOptions string) (*github.RepositoryContentGetOptions, error)
- type IGitClient
- type IOAuthClient
- type OAuthClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitClient ¶
GitClient is a wrapper around github.Client. This is done for mocking
func (*GitClient) GetRepositoryContents ¶
func (gitClient *GitClient) GetRepositoryContents( log log.T, owner, repo, path string, opt *github.RepositoryContentGetOptions, ) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, err error)
GetRepositoryContents is a wrapper around GetContents method in gitub SDK
func (*GitClient) IsFileContentType ¶
func (gitClient *GitClient) IsFileContentType(file *github.RepositoryContent) bool
IsFileContentType returns true if the repository content points to a file
func (*GitClient) ParseGetOptions ¶
func (gitClient *GitClient) ParseGetOptions(log log.T, getOptions string) (*github.RepositoryContentGetOptions, error)
ParseGetOptions manipulates the getOptions parameter and returns
type IGitClient ¶
type IGitClient interface { GetRepositoryContents(log log.T, owner, repo, path string, opt *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, err error) ParseGetOptions(log log.T, getOptions string) (*github.RepositoryContentGetOptions, error) IsFileContentType(file *github.RepositoryContent) bool }
IGitClient is an interface for type IGitClient
func NewClient ¶
func NewClient(httpClient *http.Client) IGitClient
NewClient is a constructor for GitClient
type IOAuthClient ¶
IOAuthClient is an interface for oauth access of Github
type OAuthClient ¶
type OAuthClient struct{}
OAuthClient is a wrapper around github.Client. This is done for mocking
func (OAuthClient) GetGithubOauthClient ¶
func (git OAuthClient) GetGithubOauthClient(token string) *http.Client
GetGithubOauthClient returns the http client using oauth access tokens implementation of this has been taken from https://github.com/google/go-github#authentication