headers

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: 2 Imported by: 0

Documentation

Overview

Package headers defines a middleware that adds static headers to the requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Headers

type Headers http.Header

Headers is an http.Header map that implements the httpcmw.Wrapper interface so that the headers are added to each request using the middleware. By default the header values are set (replace any existing value), but the behaviour can be controlled by prepending a "+" to the header name (add the value) or a "-" (remove this header).

func (Headers) Add

func (hd Headers) Add(k, v string)

Add adds the value v to the header k.

func (Headers) Del

func (hd Headers) Del(k string)

Del removes the header k.

func (Headers) Get

func (hd Headers) Get(k string) string

Get returns the first value of the header k.

func (Headers) Set

func (hd Headers) Set(k, v string)

Set sets the value v to the header k, replacing any existing value.

func (Headers) Wrap

func (hd Headers) Wrap(d httpcmw.Doer) httpcmw.Doer

Wrap returns a handler that adds the headers to the request's Header.

Jump to

Keyboard shortcuts

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