export

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 21 Imported by: ? 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 export forwards observed HTTP traffic to an HTTP collector.

Wrap returns an output.Writer that also implements Capture. Engines call Capture with every exchange they observe, before scope, dedupe and omit filters; exchanges are POSTed asynchronously as JSON batches so crawling never blocks on the collector. It is enabled only when KATANA_TRAFFIC_ENDPOINT and KATANA_TRAFFIC_TOKEN are set.

Index

Constants

View Source
const (
	EnvEndpoint      = "KATANA_TRAFFIC_ENDPOINT"
	EnvToken         = "KATANA_TRAFFIC_TOKEN"
	EnvAttributes    = "KATANA_TRAFFIC_ATTRIBUTES"
	EnvAllowInsecure = "KATANA_TRAFFIC_ALLOW_INSECURE"
	// EnvIncludeCredentials set to 1 exports credential headers verbatim.
	EnvIncludeCredentials = "KATANA_TRAFFIC_INCLUDE_CREDENTIALS"
)

Variables

This section is empty.

Functions

func Enabled

func Enabled() bool

Enabled reports whether traffic export is configured in the environment, even partially.

func New

func New(inner output.Writer, config Config) (output.Writer, error)

New wraps inner with an exporter for config.

func Wrap

func Wrap(inner output.Writer) (output.Writer, error)

Wrap returns inner unchanged when export is not configured. On a configuration error it also returns inner, so a bad setting never breaks crawling output.

Types

type Config

type Config struct {
	Endpoint      string
	Token         string
	Attributes    map[string]string
	AllowInsecure bool
	// IncludeCredentials exports credential headers instead of redacting them.
	IncludeCredentials bool
	HTTPClient         *http.Client
}

Config controls an exporter. Endpoint and Token must come from trusted process configuration, never from crawled content.

Jump to

Keyboard shortcuts

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