parsers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 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 EEHTTPResponseAction

type EEHTTPResponseAction struct {
	// Type is the action type.
	Type string

	// Profile is the profile name for the action.
	Profile string

	// Cond is the condition type ("if" or "unless").
	Cond string

	// CondTest is the ACL condition expression.
	CondTest string

	// Comment is the inline comment.
	Comment string
}

EEHTTPResponseAction represents an Enterprise Edition http-response action. Currently, no EE http-response actions are documented (oidc-sso was skipped). This struct is defined for future extensibility.

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) GetDirectivesByType

func (p *GlobalEE) GetDirectivesByType(directiveType string) []*EEGlobalDirective

GetDirectivesByType returns directives of a specific type.

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.

type HTTPResponses

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

HTTPResponses wraps client-native's http.Responses parser to add EE action support. It intercepts EE-specific actions before delegating to client-native for standard CE actions. Currently, no EE http-response actions are implemented, but the wrapper is ready for future use.

func NewHTTPResponses

func NewHTTPResponses() *HTTPResponses

NewHTTPResponses creates a new HTTPResponses wrapper parser.

func (*HTTPResponses) Delete

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

Delete deletes data at index.

func (*HTTPResponses) Get

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

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

func (*HTTPResponses) GetEEActions

func (p *HTTPResponses) GetEEActions() []*EEHTTPResponseAction

GetEEActions returns only the EE-specific actions.

func (*HTTPResponses) GetOne

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

GetOne returns parsed data at index.

func (*HTTPResponses) GetParserName

func (p *HTTPResponses) GetParserName() string

GetParserName returns the parser name.

func (*HTTPResponses) GetPreComments

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

GetPreComments returns pre-comments.

func (*HTTPResponses) Init

func (p *HTTPResponses) Init()

Init initializes the parser.

func (*HTTPResponses) Insert

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

Insert inserts data at index.

func (*HTTPResponses) Parse

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

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

func (*HTTPResponses) PreParse

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

PreParse is called before Parse for preprocessor handling.

func (*HTTPResponses) ResultAll

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

ResultAll returns all results for serialization.

func (*HTTPResponses) Set

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

Set sets data at index.

func (*HTTPResponses) SetPreComments

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

SetPreComments sets pre-comments.

type HTTPResponsesData

type HTTPResponsesData struct {
	CEActions any
	EEActions []*EEHTTPResponseAction
}

HTTPResponsesData holds both CE and EE http-response actions.

Jump to

Keyboard shortcuts

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