github

package
v0.0.0-...-6542a44 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeContext = "goutility/github"

	NoClientProvidedCode goutility.ErrorCode = 1 << iota
	ListingReposInOrgCode

	NoRepoProvidedCode

	PathIsNotAFileIsADirectoryCode

	NoOptionsProvidedCode

	UnableToDetermineStatusOfFileCode
)

Variables

This section is empty.

Functions

func CreateOrUpdateFile

func CreateOrUpdateFile(client *github.Client, repository *github.Repository, path string, options *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, error)

func FindRepoByOrg

func FindRepoByOrg(client *github.Client, orgName string, repoName string) (*github.Repository, error)

func GetFileContents

func GetFileContents(client *github.Client, repository *github.Repository, path string) (*github.RepositoryContent, error)

func MakeClientWithOauth2StaticToken

func MakeClientWithOauth2StaticToken(accessToken string) *github.Client

func TestCreateFile

func TestCreateFile(t *testing.T)

func TestCreateFile_existing

func TestCreateFile_existing(t *testing.T)

func TestCreateOrUpdateFile_create

func TestCreateOrUpdateFile_create(t *testing.T)

func TestCreateOrUpdateFile_update

func TestCreateOrUpdateFile_update(t *testing.T)

func TestFindRepoByOrg

func TestFindRepoByOrg(t *testing.T)

func TestFindRepoByOrg_invalid

func TestFindRepoByOrg_invalid(t *testing.T)

func TestGetContents

func TestGetContents(t *testing.T)

func TestGetContents_invalid

func TestGetContents_invalid(t *testing.T)

func TestMakeClientWithOauth2StaticToken

func TestMakeClientWithOauth2StaticToken(t *testing.T)

func TestUpdateFile

func TestUpdateFile(t *testing.T)

Types

type ListingReposInOrgError

type ListingReposInOrgError struct {
	goutility.ErrorType
	// contains filtered or unexported fields
}

region Listing Repos In Org

func MakeListingReposInOrgError

func MakeListingReposInOrgError(orgName string, underlyingError error) ListingReposInOrgError

func (ListingReposInOrgError) OrgName

func (this ListingReposInOrgError) OrgName() string

func (ListingReposInOrgError) UnderlyingError

func (this ListingReposInOrgError) UnderlyingError() error

type NoClientProvidedError

type NoClientProvidedError struct {
	goutility.ErrorType
}

region No Client Provided

func MakeNoClientProvidedError

func MakeNoClientProvidedError() NoClientProvidedError

type NoOptionsProvidedError

type NoOptionsProvidedError struct {
	goutility.ErrorType
}

region No Options Provided

func MakeNoOptionsProvidedError

func MakeNoOptionsProvidedError() NoOptionsProvidedError

type NoRepoProvidedError

type NoRepoProvidedError struct {
	goutility.ErrorType
}

region No Repo Provided

func MakeNoRepoProvidedError

func MakeNoRepoProvidedError() NoRepoProvidedError

type PathIsNotAFileIsADirectoryError

type PathIsNotAFileIsADirectoryError struct {
	goutility.ErrorType
	// contains filtered or unexported fields
}

region Path Is Not A File Is A Directory

func MakeNotAFileIsADirectoryError

func MakeNotAFileIsADirectoryError(path string) PathIsNotAFileIsADirectoryError

func (PathIsNotAFileIsADirectoryError) Path

type UnableToDetermineStatusOfFileError

type UnableToDetermineStatusOfFileError struct {
	goutility.ErrorType
	// contains filtered or unexported fields
}

region Unable To Determine Status of File

func MakeUnableToDetermineStatusOfFileError

func MakeUnableToDetermineStatusOfFileError(path string) UnableToDetermineStatusOfFileError

func (UnableToDetermineStatusOfFileError) Path

type UnableToFindRepoError

type UnableToFindRepoError struct {
	goutility.ErrorType
	// contains filtered or unexported fields
}

region Unable To Find Repo

func MakeUnableToFindRepoError

func MakeUnableToFindRepoError(orgName string, repoName string) UnableToFindRepoError

func (UnableToFindRepoError) OrgName

func (this UnableToFindRepoError) OrgName() string

func (UnableToFindRepoError) RepoName

func (this UnableToFindRepoError) RepoName() string

Jump to

Keyboard shortcuts

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