polling

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package polling holds helpers shared by generated *AndPoll service methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecoverActionBody

func RecoverActionBody[T any](raw *http.Response, recovered *T, opts ...option.RequestOption) ([]byte, error)

RecoverActionBody recovers the action response payload after the synchronous create/update returned, so the *AndPoll polling loop can enrich it.

It tries, in order:

  • reading raw.Body (works when the caller passed WithResponseBodyInto with a **http.Response target — the request executor leaves the body intact).
  • the bytes already populated into the caller's *[]byte target by the request executor (the body itself has been drained, but the bytes survive in the user's destination).

On success, raw.Body is reset to a fresh reader over the recovered bytes so downstream code can re-read it.

func WriteResponseBodyInto added in v0.47.0

func WriteResponseBodyInto(opts []option.RequestOption, enriched []byte)

WriteResponseBodyInto propagates the post-poll (status-enriched) body back to the *[]byte target the caller configured via option.WithResponseBodyInto, so they observe the polled state rather than the original action response. No-op when the caller did not request a *[]byte body.

Types

This section is empty.

Jump to

Keyboard shortcuts

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