CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/golang-github-com-google-go-github

Go client library for accessing the GitHub API v3

Agent Success

Agent success rate when using this tile

65%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.14x

Baseline

Agent success rate without this tile

57%

Overview
Eval results
Files

task.mdevals/scenario-5/

GitHub Client Bootstrapper

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.

Capabilities

Defaults for public GitHub

  • When no host overrides are provided, REST requests are rooted at the public API host, upload requests use the public upload host, and both carry the configured user agent and API version headers. @test

Token authentication

  • When a personal access token is supplied, every REST request built by the helper includes the correct bearer Authorization header without extra caller work. @test

Enterprise host selection

  • When API and upload hosts are supplied, requests created by the helper use those enterprise hosts instead of the public defaults. @test

Upload host usage

  • Upload requests use the configured upload host and preserve token and user agent headers. @test

Implementation

@generates

API

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)

Dependencies { .dependencies }

github.com/google/go-github/v80/github { .dependency }

Typed GitHub REST v3 client used to construct authenticated REST and upload requests against public and enterprise hosts.

tessl i tessl/golang-github-com-google-go-github@79.0.1

tile.json