libgh

package
v0.0.0-...-00f2437 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserClient

func NewUserClient(ctx context.Context, githubAuthToken string) *github.Client

NewUserClient creates a new GitHub API client with a user's GitHub authentication token

Types

type ExchangeGitHubCodeRequest

type ExchangeGitHubCodeRequest struct {
	// ClientID is the GitHub app's Client ID
	ClientID string `json:"client_id"`

	// ClientSecret is the GitHub app's client secret
	ClientSecret string `json:"client_secret"`

	// Code is the temporary GitHub authentication code
	Code string `json:"code"`

	// State is a value used to prevent cross site request forgery
	State string `json:"state"`
}

ExchangeGitHubCodeRequest holds the parameters required to make a GitHub API request to exchange a temporary GitHub code for a longer lasting GitHub token

func NewExchangeGitHubCodeRequest

func NewExchangeGitHubCodeRequest(cfg config.Config, code, state string) ExchangeGitHubCodeRequest

NewExchangeGitHubCodeRequest creates a new ExchangeGitHubCodeRequest. Most of the fields can be filled by passing an config.Config object

func (ExchangeGitHubCodeRequest) Do

Exchange exchanges a temporary GitHub code for a longer lasting GitHub token

type GetRepositoryRequest

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

GetRepositoryRequest are the parameters for a get repository GitHub API request

func NewGetRepositoryRequest

func NewGetRepositoryRequest(ctx context.Context, client *github.Client, owner, name string) GetRepositoryRequest

NewGetRepositoryRequest creates a new GetRepositoryRequest

func (GetRepositoryRequest) Do

GetRepository makes a get repository GitHub API request

type IdentifyAuthTokenRequest

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

IdentifyAuthTokenRequest holds the parameters of a GitHub API request to identify the owner of a GitHub authentication token

func NewIdentifyAuthTokenRequest

func NewIdentifyAuthTokenRequest(ctx context.Context, authToken string) IdentifyAuthTokenRequest

NewIdentifyAuthTokenRequest creates a new IdentifyAuthTokenRequest

func (IdentifyAuthTokenRequest) Do

Identify returns the user ID of the GitHub user who owns the provided GH auth token

type ListIssuesRequest

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

ListIssuesRequest holds the parameters for a list issues GitHub API request

func NewListIssuesRequest

func NewListIssuesRequest(ctx context.Context, client *github.Client, owner, name string) ListIssuesRequest

NewListIssuesRequest creates a new ListIssuesRequest

func (ListIssuesRequest) Do

func (r ListIssuesRequest) Do() ([]*github.Issue, error)

ListIssues makes the list issues GitHub API request

Jump to

Keyboard shortcuts

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