githubclient

package
v0.0.0-...-6ae9397 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package githubclient contains methods for interacting with git

Package githubclient contains methods for interacting with git

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitClient

type GitClient struct {
	*github.Client
}

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

type IOAuthClient interface {
	GetGithubOauthClient(token string) *http.Client
}

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

Directories

Path Synopsis
Package mock_githubclient contains methods to mock githubclient package
Package mock_githubclient contains methods to mock githubclient package

Jump to

Keyboard shortcuts

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