github

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(token, host string) (provider.Provider, error)

New builds a GitHub provider. host defaults to "github.com" when empty. A non-default host is treated as GitHub Enterprise: the REST base URL is set to https://<host>/api/v3/ and clone URLs use <host> directly.

Types

type Client

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

func (*Client) CloneURL

func (c *Client) CloneURL(protocol, fullName string) string

CloneURL returns the git clone URL for a repo identified by its full name ("owner/repo"), using "ssh" or "https". GitHub's format:

ssh:   git@<host>:owner/repo.git
https: https://<host>/owner/repo.git

func (*Client) DetectOwner

func (c *Client) DetectOwner(ctx context.Context, owner string) (bool, error)

DetectOwner reports whether the given owner name is an organization (true) or a user (false). Uses a single lightweight GET to /orgs/{owner}; any non-404 error is returned as-is.

func (*Client) Host

func (c *Client) Host() string

Host returns the clone/API host for this provider.

func (*Client) ListPullRequests

func (c *Client) ListPullRequests(ctx context.Context, owner, repoName string, opts provider.ListPROptions) ([]*provider.PullRequest, error)

func (*Client) ListRepos

func (c *Client) ListRepos(ctx context.Context, owner string, opts provider.ListOptions) ([]*provider.Repo, error)

Jump to

Keyboard shortcuts

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