reader_config

package
v1.107.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxReconnects bounds the attempts in a row that bring no bytes:
	// a read broken off, or a request to resume it that fails. Progress resets
	// the count.
	DefaultMaxReconnects = 8
	// DefaultRetryBaseDelay is the wait before the second attempt in a row;
	// each one after that waits twice as long, up to DefaultRetryMaxDelay.
	DefaultRetryBaseDelay = time.Second
	DefaultRetryMaxDelay  = 32 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Generation pins the object generation to read. Zero reads the live one,
	// and pins whatever generation that turns out to be.
	Generation int64
	// Offset is the first byte read.
	Offset int64
	// Length is how many bytes are read from Offset; zero or less reads to the
	// end of the object.
	Length         int64
	MaxReconnects  int
	RetryBaseDelay time.Duration
	RetryMaxDelay  time.Duration
	FetchOptions   []fetch_config.Option
}

func New

func New(options ...Option) *Config

type Option

type Option func(*Config)

func WithFetchOptions

func WithFetchOptions(fetchOptions ...fetch_config.Option) Option

func WithGeneration

func WithGeneration(generation int64) Option

func WithMaxReconnects

func WithMaxReconnects(maxReconnects int) Option

func WithRange

func WithRange(offset int64, length int64) Option

func WithRetryDelays

func WithRetryDelays(baseDelay time.Duration, maxDelay time.Duration) Option

Jump to

Keyboard shortcuts

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