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

capture

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Overview

Package capture provides a partitioned upstream that remembers the last request it received per path. It exists for policies that rewrite a request on the way in and rewrite the response back on the way out (masking, redaction): the client-visible response can never show what the upstream actually received, because the response-side rewrite has already reversed it by the time a test observes that response. This service lets a test ask the upstream directly, in a second call, independent of any response rewriting.

Index

Constants

View Source
const Port = 3010

Port is the container port used by the testbench.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service implements testbench.Service and testbench.Partitioned.

func New

func New() *Service

New returns a new capture service.

func NewWithRetentionLimit

func NewWithRetentionLimit(limit int) *Service

NewWithRetentionLimit returns a capture service with a per-partition limit on distinct paths. A non-positive limit uses the safe default.

func (*Service) Handler

func (s *Service) Handler() http.Handler

Handler serves the partitioned routes.

func (*Service) Name

func (s *Service) Name() string

Name returns the service registration name.

func (*Service) PartitionKey

func (s *Service) PartitionKey() string

PartitionKey returns the partitioning strategy used by this stateful service.

func (*Service) Port

func (s *Service) Port() int

Port returns the service's listening port.

func (*Service) Stateful

func (s *Service) Stateful() bool

Stateful reports whether the service keeps request-specific state.

Jump to

Keyboard shortcuts

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