Documentation
¶
Index ¶
Constants ¶
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 ¶
type Header struct {
// contains filtered or unexported fields
}
Header is a simple header struct
func (Header) HeaderValue ¶
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