github

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package github is the provider.Client implementation for GitHub.com and GitHub Enterprise (via the Host option).

Wraps go-github + oauth2. Constructed via New; the returned concrete type satisfies provider.Client structurally.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingOwnerRepo = errors.New("github: Owner and Repo are required")

ErrMissingOwnerRepo is returned when the Options doesn't carry both an owner and repo. Without them every API call is meaningless.

Functions

func New

func New(ctx context.Context, opts Options) (provider.Client, error)

New returns a provider.Client backed by go-github, authenticated by opts.Token (empty token yields an unauthenticated client). When opts.Host is non-empty, the client targets a GitHub Enterprise installation.

Types

type Options

type Options struct {
	// Owner is the GitHub user or org that owns the repo (e.g.
	// "disaresta-org").
	Owner string

	// Repo is the repository name (e.g. "monorel").
	Repo string

	// Host is the API host for GitHub Enterprise (e.g.
	// "github.example.com"). Empty means use the public api.github.com.
	Host string

	// Token is the personal access token or installation token
	// used for authenticated API calls. Required for any operation
	// that creates or modifies state; reads against public repos
	// also work without one but get tighter rate limits.
	Token string
}

Options configures a new GitHub-backed provider.Client.

Jump to

Keyboard shortcuts

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