github

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 11 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultClient is the default GitHub client.
	DefaultClient = &defaultGitHub{
		httpClient: defaultHTTPClient(),
		urlParse:   url.Parse,
	}
)

Functions

This section is empty.

Types

type ContentSpec added in v0.12.0

type ContentSpec struct {
	Repo
	Path    string // Path within repo to fetch
	RefSpec string // A git refspec - branch, tag, or commit sha1.
}

ContentSpec represents coordinates for fetching contents from a GitHub repo

func (ContentSpec) String added in v0.12.0

func (c ContentSpec) String() string

type GitHub

type GitHub interface {
	ValidateURL(u string) error
	CommitSHA1(ctx context.Context, repo Repo, refSpec string) (string, error)
	Contents(ctx context.Context, repo Repo, path, sha1 string) (*github.RepositoryContent, []*github.RepositoryContent, error)
}

GitHub is an interface for communicating with GitHub.

func NewGitHub added in v0.13.0

func NewGitHub(httpClient *http.Client) GitHub

NewGitHub constructs a GitHub client

type Repo

type Repo struct {
	Org  string
	Repo string
}

Repo is a GitHub repo

func (Repo) String added in v0.12.0

func (r Repo) String() string

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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