Help us shape the future of Go! Take the 2026 Go Developer Survey

httptrack

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package httptrack implements HTTP observation policy without telemetry state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalDestination

func InternalDestination(host string) bool

InternalDestination classifies a normalized host without DNS resolution. Private literals, single-label names and explicit internal suffixes qualify.

func MatchHost

func MatchHost(host string, patterns []string) bool

MatchHost matches normalized hosts to lowercased exact or wildcard patterns. A wildcard requires a subdomain; it never admits the bare domain.

func Method

func Method(method string) string

Method bounds method cardinality without retaining arbitrary request text.

func NewBody

func NewBody(original io.ReadCloser, finish func(error)) io.ReadCloser

NewBody observes completion without changing read results or close errors. Close errors are returned to the caller, not reported as read failures.

func NormalizeHost

func NormalizeHost(host string) string

NormalizeHost lowercases a host and drops one trailing root dot.

func Port

func Port(request *http.Request) int

Port returns the explicit URL port, the scheme default, or zero if unknown.

func ProtocolVersion

func ProtocolVersion(protocol string) string

ProtocolVersion removes an HTTP/ prefix when present.

func RemoteIP

func RemoteIP(request *http.Request) (netip.Addr, bool)

RemoteIP parses only the peer address, never caller-controlled forwarding headers. IPv4-mapped addresses are unmapped and zones are removed.

func Route

func Route(request *http.Request) string

Route returns the matched route template without its method prefix.

func Scheme

func Scheme(request *http.Request) string

Scheme reports the incoming transport scheme, ignoring forwarded headers.

func SpanName

func SpanName(method, route string) string

SpanName names unknown methods HTTP and omits absent routes, never replacing a missing template with an unbounded request path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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