Versions in this module Expand all Collapse all v3 v3.0.0 Apr 8, 2024 Changes in this version + type ComparisonSummary struct + type InstrumentationServer struct + func NewInstrumentationServer(port int, registry *prometheus.Registry, logger log.Logger) *InstrumentationServer + func (s *InstrumentationServer) Start() error + func (s *InstrumentationServer) Stop() + type Proxy struct + func NewProxy(cfg ProxyConfig, logger log.Logger, readRoutes, writeRoutes []Route, ...) (*Proxy, error) + func (p *Proxy) Await() + func (p *Proxy) Endpoint() string + func (p *Proxy) Start() error + func (p *Proxy) Stop() error + type ProxyBackend struct + func NewProxyBackend(name string, endpoint *url.URL, timeout time.Duration, preferred bool) *ProxyBackend + func (b *ProxyBackend) ForwardRequest(orig *http.Request, body io.ReadCloser) (int, []byte, error) + func (b *ProxyBackend) WithFilter(f *regexp.Regexp) *ProxyBackend + type ProxyConfig struct + BackendEndpoints string + BackendReadTimeout time.Duration + CompareResponses bool + DisableBackendReadProxy string + InstrumentCompares bool + PassThroughNonRegisteredRoutes bool + PreferredBackend string + RequestURLFilter *regexp.Regexp + ServerServicePort int + SkipRecentSamples time.Duration + UseRelativeError bool + ValueComparisonTolerance float64 + func (cfg *ProxyConfig) RegisterFlags(f *flag.FlagSet) + type ProxyEndpoint struct + func NewProxyEndpoint(backends []*ProxyBackend, routeName string, metrics *ProxyMetrics, ...) *ProxyEndpoint + func (p *ProxyEndpoint) ServeHTTP(w http.ResponseWriter, r *http.Request) + type ProxyMetrics struct + func NewProxyMetrics(registerer prometheus.Registerer) *ProxyMetrics + type ResponsesComparator interface + Compare func(expected, actual []byte) (*ComparisonSummary, error) + type Route struct + Methods []string + Path string + ResponseComparator ResponsesComparator + RouteName string + type SampleComparisonOptions struct + SkipRecentSamples time.Duration + Tolerance float64 + UseRelativeError bool + type SamplesComparator struct + func NewSamplesComparator(opts SampleComparisonOptions) *SamplesComparator + func (s *SamplesComparator) Compare(expectedResponse, actualResponse []byte) (*ComparisonSummary, error) + func (s *SamplesComparator) RegisterSamplesType(samplesType string, comparator SamplesComparatorFunc) + type SamplesComparatorFunc func(expected, actual json.RawMessage, opts SampleComparisonOptions) (*ComparisonSummary, error) + type SamplesResponse struct + Data struct{ ... } + Status string