warc

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RecordTypeRequest is used for requests.
	RecordTypeRequest = "request"

	// RecordTypeResponse is used for responses.
	RecordTypeResponse = "response"

	// RecordTypeMetadata is used for metadata.
	RecordTypeMetadata = "metadata"
)

Variables

View Source
var (
	// ErrBreakTraversal should be returned from the callback to break traversal.
	ErrBreakTraversal = errors.New("stop traversal")
)

Functions

func Traverse

func Traverse(r io.Reader, fn func(r *Record) error) error

Traverse will traverse the stream via r, calling fn for each record.

Types

type Record

type Record struct {
	Type                  string    // Type of record ("request", "response", or "metadata")
	TargetURI             string    // Target URI of the record
	IdentifiedPayloadType string    // Identified MIME type of the payload
	HTTPContentType       string    // Content type defined by HTTP header
	Content               io.Reader // Reader for the content
}

Record contains all information about a record.

Jump to

Keyboard shortcuts

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