github

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Namespace = "github"

Namespace is the package namespace, used for things like envvars.

Variables

View Source
var ErrUserNotExists = stderrs.New("no such user or organization exists")

ErrUserNotExists is returned by a RepoLister when it is unable to locate either a user or organization with a given username.

Functions

func NewClient

func NewClient(opts ...func(*ClientConfig)) (*github.Client, error)

NewClient creates a new GitHub client.

If the environment contains a 'GITHUB_TOKEN' variable, then an authenticated client will be created; otherwise, the client will be unauthenticated.

Types

type ClientConfig

type ClientConfig struct {
	HTTPClient *http.Client
}

ClientConfig configures a github.Client.

type Lister

type Lister struct {
	// contains filtered or unexported fields
}

A Lister can list GitHub repos containing Go for a particular user / organization.

func NewLister

func NewLister(
	c *github.Client,
	username string,
	opts ...func(*ListerConfig),
) *Lister

NewLister creates a new Service that lists repositories for the specified user.

func (*Lister) DeriveRepoFullName

func (l *Lister) DeriveRepoFullName(partial string) (repo string)

DeriveRepoFullName derives the full name of a repo from a partial name.

func (*Lister) ListGoRepos

func (l *Lister) ListGoRepos() ([]string, error)

ListGoRepos lists all the repos that use Go.

type ListerConfig

type ListerConfig struct {
	Concurrency int
}

A ListerConfig configures a Service.

Jump to

Keyboard shortcuts

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