net

package
v0.26.16 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GitHubClient = &http.Client{
	Timeout: 30 * time.Second,
	CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
		return http.ErrUseLastResponse
	},
}

GitHubClient is a shared HTTP client for GitHub API and OAuth calls. Does not follow redirects (OAuth token exchange needs raw response).

View Source
var QuotaCheckClient = &http.Client{Timeout: 5 * time.Second}

QuotaCheckClient is a lightweight HTTP client for GitHub rate limit checks.

Functions

func SendEmail

func SendEmail(ctx context.Context, apiKey, from, to, subject, html, text, replyTo string, opts ...EmailOption) 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. unsubURL is optional — if non-empty, adds List-Unsubscribe header for email clients (e.g. Gmail) to show a native unsubscribe option.

Types

type EmailOption

type EmailOption func(payload map[string]any)

EmailOption configures optional email parameters.

func WithUnsubscribeURL

func WithUnsubscribeURL(url string) EmailOption

WithUnsubscribeURL adds a List-Unsubscribe header to the email.

Jump to

Keyboard shortcuts

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