requestid

package
v0.0.0-...-14ea052 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package requestid implements an HTTP client middleware that generates a random request ID.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestID

type RequestID struct {
	// ForceSet replaces the existing value for the request ID Header if true.
	// If false, it sets a request ID only if there was none. Defaults to false.
	ForceSet bool

	// Len is the length of the generated request ID. The ID is hex-encoded,
	// this is the length of the final hex-encoded string, not the number of
	// random bytes used. Defaults to 8.
	Len int

	// Header is the name of the header to use to store the request ID. Defaults
	// to X-Request-Id.
	Header string
}

RequestID holds the configuration for the request ID middleware.

func (*RequestID) Wrap

func (rid *RequestID) Wrap(d httpcmw.Doer) httpcmw.Doer

Wrap returns a Doer that sets a random request ID header before calling the Doer d.

Jump to

Keyboard shortcuts

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