net

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitHubTimeout is the default timeout for GitHub API calls.
	GitHubTimeout = 10 * time.Second

	// GitHubAccept is the standard Accept header for GitHub API v3.
	GitHubAccept = "application/vnd.github+json"

	// QuotaCheckTimeout is a short timeout for lightweight API quota checks.
	QuotaCheckTimeout = 5 * time.Second
)

Variables

View Source
var GitHubClient = &http.Client{Timeout: GitHubTimeout}

GitHubClient is a shared HTTP client for GitHub API calls.

View Source
var QuotaCheckClient = &http.Client{Timeout: QuotaCheckTimeout}

QuotaCheckClient is a shared HTTP client for lightweight rate-limit checks.

Functions

func GetOAuthClient

func GetOAuthClient(_ context.Context, token string) *http.Client

GetOAuthClient returns an HTTP client that injects a Bearer token into every request.

func PrintHTTPResponse

func PrintHTTPResponse(resp *http.Response)

func SetGitHubHeaders added in v0.30.5

func SetGitHubHeaders(req *http.Request, token string)

SetGitHubHeaders sets the standard Authorization and Accept headers for GitHub API requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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