capture

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package capture streams HTTP bodies into the store as they pass through, without buffering them in memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capturer

type Capturer struct {
	// contains filtered or unexported fields
}

Capturer creates body-capturing tees backed by a Store.

func New

func New(st *store.Store) *Capturer

New returns a Capturer writing to st.

func (*Capturer) TeeBody

func (c *Capturer) TeeBody(src io.Reader) (r io.Reader, finalize func() (string, int64, error), err error)

TeeBody wraps src so that every byte read from the returned reader is also written to the store. Call finalize after the reader is fully consumed to commit the body and obtain its hash and length. If src is nil, the returned reader is empty and finalize reports an empty body.

Jump to

Keyboard shortcuts

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