header

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	Remove Action = iota
	RemoveByPrefix
	Empty
	Add
)
type Header struct {
	Name   string
	Action Action
	Value  *string
}

func ParseHeader

func ParseHeader(val string) (Header, error)

ParseHeader supports the following syntax: - "<name>: <value>" to add a header, - "<name>;" to set a header to empty, - "-<name>" to remove a header, - "-<name>*" to remove a header by prefix.

func (*Header) Apply

func (h *Header) Apply(hh http.Header)

func (*Header) String added in v1.0.1

func (h *Header) String() string

type Headers

type Headers []Header

func (Headers) ModifyRequest

func (s Headers) ModifyRequest(req *http.Request) error

func (Headers) ModifyResponse

func (s Headers) ModifyResponse(res *http.Response) error

Jump to

Keyboard shortcuts

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