net

package
v0.51.33 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 10 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 SendEmail added in v0.42.3

func SendEmail(ctx context.Context, apiKey, from, to, subject, html, text, replyTo string) error

SendEmail sends an email via the Resend API. The apiKey is a Resend API key. from and to are email addresses; subject, html, and text are the message content. replyTo is optional — if non-empty, sets the Reply-To header on the email.

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