Documentation ¶
Index ¶
- Constants
- func Bool(b bool) *bool
- func ISOTimeString(tm time.Time) *string
- func Int64(i int64) *int64
- func RateLimit(r *http.Response) int
- func RateLimitRemaining(r *http.Response) int
- func RateLimitReset(r *http.Response) time.Time
- func RelLink(r *http.Response, lnk string) string
- func String(s string) *string
- func WithAllPreviews() requests.Option
- func WithAppAuth(appID int64, privateKey []byte) requests.Option
- func WithAppInstallationAuth(installationID int64, client Client, ...) requests.Option
- func WithAuthProvider(authProvider requests.AuthProvider) requests.Option
- func WithBaseURL(baseURL url.URL) requests.Option
- func WithHTTPClient(client *http.Client) requests.Option
- func WithPATAuth(token string) requests.Option
- func WithRequiredPreviews() requests.Option
- func WithUserAgent(userAgent string) requests.Option
- type Client
- func (c Client) Actions() actions.Client
- func (c Client) Activity() activity.Client
- func (c Client) Apps() apps.Client
- func (c Client) Billing() billing.Client
- func (c Client) Checks() checks.Client
- func (c Client) CodeScanning() codescanning.Client
- func (c Client) CodesOfConduct() codesofconduct.Client
- func (c Client) Emojis() emojis.Client
- func (c Client) Gists() gists.Client
- func (c Client) Git() git.Client
- func (c Client) Gitignore() gitignore.Client
- func (c Client) Interactions() interactions.Client
- func (c Client) Issues() issues.Client
- func (c Client) Licenses() licenses.Client
- func (c Client) Markdown() markdown.Client
- func (c Client) Meta() meta.Client
- func (c Client) Migrations() migrations.Client
- func (c Client) OauthAuthorizations() oauthauthorizations.Client
- func (c Client) Orgs() orgs.Client
- func (c Client) Projects() projects.Client
- func (c Client) Pulls() pulls.Client
- func (c Client) RateLimit() ratelimit.Client
- func (c Client) Reactions() reactions.Client
- func (c Client) Repos() repos.Client
- func (c Client) Scim() scim.Client
- func (c Client) Search() search.Client
- func (c Client) Teams() teams.Client
- func (c Client) Users() users.Client
- type ResponseError
Constants ¶
const ( RelNext = "next" RelPrev = "prev" RelFirst = "first" RelLast = "last" )
Common values for rel links
Variables ¶
This section is empty.
Functions ¶
func ISOTimeString ¶
ISOTimeString returns a pointer to tm formated as an iso8601/rfc3339 string
func RateLimit ¶ added in v0.8.0
RateLimit - The maximum number of requests you're permitted to make per hour.
returns -1 if no X-RateLimit-Limit value exists in the response header
func RateLimitRemaining ¶ added in v0.8.0
RateLimitRemaining - The number of requests remaining in the current rate limit window.
returns -1 if no X-RateLimit-Remaining value exists in the response header
func RateLimitReset ¶ added in v0.8.0
RateLimitReset - X-RateLimit-Reset
returns time.Zero if no X-RateLimit-Reset value exists in the response header
func RelLink ¶ added in v0.8.0
RelLink returns the content of lnk from the response's Link header or "" if it does not exist
func WithAllPreviews ¶
WithAllPreviews enables all previews that are available for your request
func WithAppAuth ¶
WithAppAuth provides authentication for a GitHub App. See also WithAppInstallationAuth
appID is the GitHub App's id privateKey is the app's private key. It should be the content of a PEM file
func WithAppInstallationAuth ¶
func WithAppInstallationAuth(installationID int64, client Client, requestBody *apps.CreateInstallationAccessTokenReqBody) requests.Option
WithAppInstallationAuth provides authentication for a GitHub App installation
client is the client to use when fetching the installation token. It should use WithAppAuth. requestBody is used to restrict access to the installation token. Leave it nil if you don't want to restrict access.
func WithAuthProvider ¶
func WithAuthProvider(authProvider requests.AuthProvider) requests.Option
WithAuthProvider sets a provider to use in setting the Authentication header
This is for custom providers. You will typically want to use WithPATAuth, WithAppAuth or WithAppInstallationAuth instead.
func WithBaseURL ¶
WithBaseURL set the baseURL to use. Default is https://api.github.com
func WithHTTPClient ¶
WithHTTPClient sets an http client to use for requests. If unset, http.DefaultClient is used
func WithPATAuth ¶
WithPATAuth authenticates requests with a Personal Access Token
func WithRequiredPreviews ¶
WithRequiredPreviews enables any previews that are required for your request
func WithUserAgent ¶
WithUserAgent sets the User-Agent header in requests
Types ¶
type Client ¶
Client is a set of options to apply to requests
func (Client) CodeScanning ¶ added in v0.8.0
func (c Client) CodeScanning() codescanning.Client
CodeScanning returns a codescanning.Client
func (Client) CodesOfConduct ¶ added in v0.8.0
func (c Client) CodesOfConduct() codesofconduct.Client
CodesOfConduct returns a codesofconduct.Client
func (Client) Interactions ¶ added in v0.8.0
func (c Client) Interactions() interactions.Client
Interactions returns a interactions.Client
func (Client) Migrations ¶ added in v0.8.0
func (c Client) Migrations() migrations.Client
Migrations returns a migrations.Client
func (Client) OauthAuthorizations ¶ added in v0.8.0
func (c Client) OauthAuthorizations() oauthauthorizations.Client
OauthAuthorizations returns a oauthauthorizations.Client
type ResponseError ¶ added in v0.8.0
type ResponseError interface { HttpResponse() *http.Response Error() string Data() *components.ResponseErrorData // data from the error body if it can be unmarshalled IsClientError() bool // true if the http status is in the 4xx range IsServerError() bool // true if the http status is in the 5xx range }
ResponseError is an error from an *http.Response.