utils

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHTTPTimeout is used for quick API calls like validation
	DefaultHTTPTimeout = 30 * time.Second

	// UploadHTTPTimeout is used for potentially large file uploads
	UploadHTTPTimeout = 5 * time.Minute
)

HTTP client timeouts

View Source
const (
	// ServerReadTimeout is the maximum duration for reading the entire request
	ServerReadTimeout = 30 * time.Second

	// ServerWriteTimeout is the maximum duration before timing out writes of the response
	ServerWriteTimeout = 30 * time.Second

	// ServerIdleTimeout is the maximum duration to wait for the next request when keep-alives are enabled
	ServerIdleTimeout = 60 * time.Second
)

HTTP server timeouts

View Source
const (
	// OAuthFlowTimeout is the maximum time to wait for user to complete OAuth authentication
	OAuthFlowTimeout = 5 * time.Minute
)

User interaction timeouts

Variables

This section is empty.

Functions

func TruncateEnd

func TruncateEnd(s string, maxLen int) string

TruncateEnd shortens a string for display by keeping the beginning and adding ellipsis at the end if it exceeds maxLen

func TruncateSecret

func TruncateSecret(s string, prefixLen, suffixLen int) string

TruncateSecret safely truncates a secret string for display. Returns a string like "abc123...wxyz" showing prefix and suffix. If the string is too short, returns a masked version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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