header

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OriginalHdr = iota // Before a VCL_call headers are original (as sent by the client or before VCL processing)
	AddedHdr           // Non original headers added in VCL (even if modified later in VCL)
	ModifiedHdr        // Original headers modified
	DeletedHdr         // Original headers deleted
)

Header States NOTE: host and location headers are converted to lowercase also in HTTP2 all client headers are lowercased

Variables

This section is empty.

Functions

This section is empty.

Types

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

Header is a simple header struct

func (Header) Header

func (h Header) Header() string

func (Header) HeaderValue

func (h Header) HeaderValue() string

type HeaderState

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

HeaderState stores the state of a header

func (HeaderState) FinalValue

func (hs HeaderState) FinalValue() string

func (HeaderState) Header

func (hs HeaderState) Header() string

func (HeaderState) IsOriginalHeader

func (hs HeaderState) IsOriginalHeader() bool

func (HeaderState) OriginalValue

func (hs HeaderState) OriginalValue() string

func (HeaderState) State

func (hs HeaderState) State() int

type HeaderStates

type HeaderStates []HeaderState

HeaderStates is an alias for []HeaderState with useful methods

func NewHeaderState

func NewHeaderState(records []vsl.Record, responseHdrs bool) HeaderStates

func (HeaderStates) FinalHeaders

func (h HeaderStates) FinalHeaders() []Header

FinalHeaders returns the headers after the VCL modifications those headers could be used to send the request to he backed or for the next varnish subroutine

func (HeaderStates) FindHeader

func (h HeaderStates) FindHeader(header string, original, ignoreCase bool) *Header

FindHeader searches for a specific header within HeaderStates.

Parameters: - header: the header name to search for - original: if true, searches within original headers; otherwise, searches within final headers - ignoreCase: if true, performs a case-insensitive comparison

Returns: - A pointer to the matching Header if found; otherwise, nil.

func (HeaderStates) OriginalHeaders

func (h HeaderStates) OriginalHeaders() []Header

OriginalHeaders returns the headers that were originally sent, before VCL processing

Jump to

Keyboard shortcuts

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