Go client library for accessing the GitHub API v3
Overall
score
65%
Creates a preconfigured GitHub REST client that targets either public GitHub or a GitHub Enterprise host, injects authentication, and builds REST and upload requests with consistent headers.
@generates
type ClientConfig struct {
APIBaseURL string
UploadBaseURL string
Token string
UserAgent string
APIVersion string
HTTPClient *http.Client
}
type Client struct {
RESTBaseURL *url.URL
UploadBaseURL *url.URL
HTTPClient *http.Client
UserAgent string
APIVersion string
}
// BootstrapGitHubClient builds a REST client configured for public GitHub or the supplied enterprise hosts.
func BootstrapGitHubClient(cfg ClientConfig) (*Client, error)
// NewRESTRequest builds an HTTP request rooted at the REST base URL and applies auth/user-agent/version headers.
func (c *Client) NewRESTRequest(method, relativePath string, body interface{}) (*http.Request, error)
// NewUploadRequest builds an HTTP request rooted at the upload base URL and applies auth/user-agent/version headers.
func (c *Client) NewUploadRequest(method, relativePath string, body interface{}) (*http.Request, error)Typed GitHub REST v3 client used to construct authenticated REST and upload requests against public and enterprise hosts.
Install with Tessl CLI
npx tessl i tessl/golang-github-com-google-go-githubdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10