idle

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package idle fails a call over a connection that hung: one that waits too long for its response or, once that arrives, for data from its body. Client.Stream puts the timeout on the context; the HTTP client of every provider sends requests that carry one through Do.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do added in v1.9.4

func Do(send func(*http.Request) (*http.Response, error), req *http.Request, timeout time.Duration) (*http.Response, error)

Do sends req with send and returns the response, failing the call once it waits timeout for data: for the response, the waits of any retries send makes included, or then for a read of its body. Only waiting counts: a consumer slow to read is not idle.

func Timeout

func Timeout(ctx context.Context) time.Duration

Timeout returns the timeout ctx carries, or zero.

func WithTimeout

func WithTimeout(ctx context.Context, timeout time.Duration) context.Context

WithTimeout returns ctx carrying timeout for the calls made with it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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