conveyhttp

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHeaderName = "X-Webpa-Convey"

DefaultHeaderName is the HTTP header assumed to contain Convey data when no header is supplied

Variables

View Source
var ErrMissingHeader = errors.New("No convey header present")

ErrMissingHeader indicates that no HTTP header exists which contains convey information

Functions

This section is empty.

Types

type HeaderTranslator

type HeaderTranslator interface {
	// FromHeader extracts the configued header and attempts to parse it as a convey map
	FromHeader(http.Header) (convey.C, error)

	// ToHeader takes the given convey map, converts it to a string, and sets that string into the supplied header
	ToHeader(http.Header, convey.C) error
}

HeaderTranslator is an analog to convey.Translator, except that this type works with http.Header.

func NewHeaderTranslator

func NewHeaderTranslator(headerName string, translator convey.Translator) HeaderTranslator

NewHeaderTranslator creates a HeaderTranslator that uses a convey.Translator to produce convey maps.

Jump to

Keyboard shortcuts

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