headers

package
v0.0.0-...-91868f7 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Host                       = "Host"
	Authorization              = "Authorization"
	XForwardedFor              = "X-Forwarded-For"
	AccessControlRequestMethod = "Access-Control-Request-Method"
	Origin                     = "Origin"
	XForwardedProto            = "X-Forwarded-Proto"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder for HTTP headers.

func New

func New() *Builder

New Builder for HTTP headers.

func (*Builder) Build

func (b *Builder) Build() http.Header

func (*Builder) BuildTo

func (b *Builder) BuildTo(out http.Header)

func (*Builder) Get

func (b *Builder) Get(key string) string

Get returns the current value for the key.

func (*Builder) With

func (b *Builder) With(key, value string) *Builder

With sets the given header value.

func (*Builder) WithAuthz

func (b *Builder) WithAuthz(token string) *Builder

WithAuthz sets the Authorization header with the given token.

func (*Builder) WithHost

func (b *Builder) WithHost(host string) *Builder

WithHost sets the Host header to the given value.

func (*Builder) WithXForwardedFor

func (b *Builder) WithXForwardedFor(ip string) *Builder

WithXForwardedFor sets the origin IP of the request.

Jump to

Keyboard shortcuts

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