roundtripper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package roundtripper provides a roundtripper for the SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GovExtRoundTripper

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

GovExtRoundTripper is a http.RoundTripper that injects the governor extension contexts as required to the outgoing request headers.

func NewGovExtRoundTripper

func NewGovExtRoundTripper(base roundtrip, opts ...Option) *GovExtRoundTripper

NewGovExtRoundTripper returns a new GovExtRoundTripper.

func (*GovExtRoundTripper) RoundTrip

func (rt *GovExtRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip calls the rountripper chain

type Option

type Option func(*GovExtRoundTripper)

Option is a function that configures a GovExtRoundTripper.

func WithCorrelationID

func WithCorrelationID() Option

WithCorrelationID injects the current correlation ID into the outgoing request headers.

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger sets the logger for the GovExtRoundTripper.

func WithTraceContext

func WithTraceContext() Option

WithTraceContext injects the current span context into the outgoing request headers.

Jump to

Keyboard shortcuts

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