Documentation
¶
Index ¶
- Constants
- func ExtractPath(root any, path string) (any, bool, error)
- func Interval(method string, seconds float64) time.Duration
- func ParsePath(path string) ([]pathPart, error)
- func ParseRetryAfter(value string, now time.Time) time.Time
- func PathSuggestions(root any) []string
- func PollJitter() float64
- func RetryAt(err error) time.Time
- func RetryDelay(interval time.Duration, failures int, jitter float64) time.Duration
- func RetryLabel(next, now time.Time) string
- type HTTPError
- type HTTPResult
- type Options
- type PollingFeedback
- type Service
- type ValidatorCache
Constants ¶
const MaximumPollBackoff = 15 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func ExtractPath ¶
Extract a value using a validated selection path
func ParsePath ¶
ParsePath supports dotted names, escaped delimiters, numeric indices and quoted literal keys. Empty paths select the root. Offsets are byte offsets
func ParseRetryAfter ¶
Parse bounded Retry-After seconds or a supported HTTP date
func PathSuggestions ¶
Suggest bounded selection paths from a decoded JSON value
func RetryDelay ¶
Compute bounded failure backoff with caller-supplied jitter
func RetryLabel ¶
Format the remaining retry delay for display
Types ¶
type HTTPResult ¶
type HTTPResult struct {
PollingFeedback
Status int `json:"status"`
DurationMS int64 `json:"duration_ms"`
Fields map[string]any `json:"fields"`
Missing []string `json:"missing"`
Preview any `json:"preview"`
Paths []string `json:"paths"`
Revalidated bool `json:"revalidated,omitempty"`
RetryAfter time.Time `json:"-"`
}
func Request ¶
func Request(ctx context.Context, s map[string]any, options Options) (result HTTPResult, requestErr error)
Perform a bounded HTTP request with preview and error handling
func RequestHTTP ¶
Perform an HTTP request with the default options
type Options ¶
type Options struct {
Cache *ValidatorCache
Automatic bool
StatusOnly bool
NoRedirect bool
AllowUserInfo bool
}
type PollingFeedback ¶
type Service ¶
type ValidatorCache ¶
type ValidatorCache struct {
// contains filtered or unexported fields
}
Private, process-local validator storage. Keys are salted digests of resolved requests/extraction, never plaintext URLs, headers or credentials. Values are already-redacted immutable JSON. Workers only share this bounded cache
func NewValidatorCache ¶
func NewValidatorCache() *ValidatorCache
Create a bounded HTTP validator cache
func (*ValidatorCache) Reset ¶
func (c *ValidatorCache) Reset()
Clear cached validators and response previews