parsers

package
v0.2.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package parsers provides wrapper parsers for HAProxy Enterprise Edition directives.

These wrappers intercept EE-specific directives that client-native doesn't support, while delegating standard CE directives to client-native parsers.

Package parsers provides wrapper parsers for HAProxy Enterprise Edition directives.

These wrappers intercept EE-specific directives that client-native doesn't support, while delegating standard CE directives to client-native parsers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EEFilter

type EEFilter = parserconfig.EEFilter

EEFilter is a type alias for types.EEFilter.

type EEGlobalDirective

type EEGlobalDirective = parserconfig.EEGlobalDirective

EEGlobalDirective is a type alias for types.EEGlobalDirective.

type EEHTTPRequestAction

type EEHTTPRequestAction = parserconfig.EEHTTPRequestAction

EEHTTPRequestAction is a type alias for types.EEHTTPRequestAction.

type Filters

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

Filters wraps client-native's filters.Filters parser to add EE filter support. It intercepts EE-specific filters like "filter waf" and "filter botmgmt" before delegating to client-native for standard CE filters.

func NewFilters

func NewFilters() *Filters

NewFilters creates a new Filters wrapper parser.

func (*Filters) Delete

func (p *Filters) Delete(index int) error

Delete deletes data at index.

func (*Filters) Get

func (p *Filters) Get(createIfNotExist bool) (common.ParserData, error)

Get returns all parsed data (both CE and EE filters).

func (*Filters) GetEEFilters

func (p *Filters) GetEEFilters() []*EEFilter

GetEEFilters returns only the EE-specific filters.

func (*Filters) GetOne

func (p *Filters) GetOne(index int) (common.ParserData, error)

GetOne returns parsed data at index.

func (*Filters) GetParserName

func (p *Filters) GetParserName() string

GetParserName returns the parser name.

func (*Filters) GetPreComments

func (p *Filters) GetPreComments() ([]string, error)

GetPreComments returns pre-comments.

func (*Filters) Init

func (p *Filters) Init()

Init initializes the parser.

func (*Filters) Insert

func (p *Filters) Insert(data common.ParserData, index int) error

Insert inserts data at index.

func (*Filters) Parse

func (p *Filters) Parse(line string, parts []string, comment string) (string, error)

Parse parses a filter line. It tries EE filters first, then delegates to client-native for CE filters.

func (*Filters) PreParse

func (p *Filters) PreParse(line string, parts, preComments []string, comment string) (string, error)

PreParse is called before Parse for preprocessor handling.

func (*Filters) ResultAll

func (p *Filters) ResultAll() ([]common.ReturnResultLine, []string, error)

ResultAll returns all results for serialization.

func (*Filters) Set

func (p *Filters) Set(data common.ParserData, index int) error

Set sets data at index.

func (*Filters) SetPreComments

func (p *Filters) SetPreComments(preComment []string)

SetPreComments sets pre-comments.

type FiltersData

type FiltersData struct {
	CEFilters any
	EEFilters []*EEFilter
}

FiltersData holds both CE and EE filters.

type GlobalEE

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

GlobalEE parses EE-specific global directives. It captures directives that client-native doesn't support.

func NewGlobalEE

func NewGlobalEE() *GlobalEE

NewGlobalEE creates a new GlobalEE parser.

func (*GlobalEE) Delete

func (p *GlobalEE) Delete(index int) error

Delete deletes data at index.

func (*GlobalEE) Get

func (p *GlobalEE) Get(createIfNotExist bool) (common.ParserData, error)

Get returns all parsed directives.

func (*GlobalEE) GetDirectives

func (p *GlobalEE) GetDirectives() []*EEGlobalDirective

GetDirectives returns all parsed EE global directives.

func (*GlobalEE) GetOne

func (p *GlobalEE) GetOne(index int) (common.ParserData, error)

GetOne returns parsed data at index.

func (*GlobalEE) GetParserName

func (p *GlobalEE) GetParserName() string

GetParserName returns the parser name. Returns "global-ee" to avoid collision with standard global parsers.

func (*GlobalEE) GetPreComments

func (p *GlobalEE) GetPreComments() ([]string, error)

GetPreComments returns pre-comments.

func (*GlobalEE) Init

func (p *GlobalEE) Init()

Init initializes the parser.

func (*GlobalEE) Insert

func (p *GlobalEE) Insert(data common.ParserData, index int) error

Insert inserts data at index.

func (*GlobalEE) Parse

func (p *GlobalEE) Parse(line string, parts []string, comment string) (string, error)

Parse parses an EE global directive line.

func (*GlobalEE) PreParse

func (p *GlobalEE) PreParse(line string, parts, preComments []string, comment string) (string, error)

PreParse is called before Parse for preprocessor handling.

func (*GlobalEE) ResultAll

func (p *GlobalEE) ResultAll() ([]common.ReturnResultLine, []string, error)

ResultAll returns all results for serialization.

func (*GlobalEE) Set

func (p *GlobalEE) Set(data common.ParserData, index int) error

Set sets data at index.

func (*GlobalEE) SetPreComments

func (p *GlobalEE) SetPreComments(preComment []string)

SetPreComments sets pre-comments.

type HTTPRequests

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

HTTPRequests wraps client-native's http.Requests parser to add EE action support. It intercepts EE-specific actions like waf-evaluate and botmgmt-evaluate before delegating to client-native for standard CE actions.

func NewHTTPRequests

func NewHTTPRequests() *HTTPRequests

NewHTTPRequests creates a new HTTPRequests wrapper parser.

func (*HTTPRequests) Delete

func (p *HTTPRequests) Delete(index int) error

Delete deletes data at index.

func (*HTTPRequests) Get

func (p *HTTPRequests) Get(createIfNotExist bool) (common.ParserData, error)

Get returns all parsed data (both CE and EE actions).

func (*HTTPRequests) GetEEActions

func (p *HTTPRequests) GetEEActions() []*EEHTTPRequestAction

GetEEActions returns only the EE-specific actions.

func (*HTTPRequests) GetOne

func (p *HTTPRequests) GetOne(index int) (common.ParserData, error)

GetOne returns parsed data at index.

func (*HTTPRequests) GetParserName

func (p *HTTPRequests) GetParserName() string

GetParserName returns the parser name.

func (*HTTPRequests) GetPreComments

func (p *HTTPRequests) GetPreComments() ([]string, error)

GetPreComments returns pre-comments.

func (*HTTPRequests) Init

func (p *HTTPRequests) Init()

Init initializes the parser.

func (*HTTPRequests) Insert

func (p *HTTPRequests) Insert(data common.ParserData, index int) error

Insert inserts data at index.

func (*HTTPRequests) Parse

func (p *HTTPRequests) Parse(line string, parts []string, comment string) (string, error)

Parse parses an http-request line. It tries EE actions first, then delegates to client-native for CE actions.

func (*HTTPRequests) PreParse

func (p *HTTPRequests) PreParse(line string, parts, preComments []string, comment string) (string, error)

PreParse is called before Parse for preprocessor handling.

func (*HTTPRequests) ResultAll

func (p *HTTPRequests) ResultAll() ([]common.ReturnResultLine, []string, error)

ResultAll returns all results for serialization.

func (*HTTPRequests) Set

func (p *HTTPRequests) Set(data common.ParserData, index int) error

Set sets data at index.

func (*HTTPRequests) SetPreComments

func (p *HTTPRequests) SetPreComments(preComment []string)

SetPreComments sets pre-comments.

type HTTPRequestsData

type HTTPRequestsData struct {
	CEActions any
	EEActions []*EEHTTPRequestAction
}

HTTPRequestsData holds both CE and EE http-request actions.

Jump to

Keyboard shortcuts

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