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 ¶
- type EEFilter
- type EEGlobalDirective
- type EEHTTPRequestAction
- type EEHTTPResponseAction
- type Filters
- func (p *Filters) Delete(index int) error
- func (p *Filters) Get(createIfNotExist bool) (common.ParserData, error)
- func (p *Filters) GetEEFilters() []*EEFilter
- func (p *Filters) GetOne(index int) (common.ParserData, error)
- func (p *Filters) GetParserName() string
- func (p *Filters) GetPreComments() ([]string, error)
- func (p *Filters) Init()
- func (p *Filters) Insert(data common.ParserData, index int) error
- func (p *Filters) Parse(line string, parts []string, comment string) (string, error)
- func (p *Filters) PreParse(line string, parts, preComments []string, comment string) (string, error)
- func (p *Filters) ResultAll() ([]common.ReturnResultLine, []string, error)
- func (p *Filters) Set(data common.ParserData, index int) error
- func (p *Filters) SetPreComments(preComment []string)
- type FiltersData
- type GlobalEE
- func (p *GlobalEE) Delete(index int) error
- func (p *GlobalEE) Get(createIfNotExist bool) (common.ParserData, error)
- func (p *GlobalEE) GetDirectives() []*EEGlobalDirective
- func (p *GlobalEE) GetDirectivesByType(directiveType string) []*EEGlobalDirective
- func (p *GlobalEE) GetOne(index int) (common.ParserData, error)
- func (p *GlobalEE) GetParserName() string
- func (p *GlobalEE) GetPreComments() ([]string, error)
- func (p *GlobalEE) Init()
- func (p *GlobalEE) Insert(data common.ParserData, index int) error
- func (p *GlobalEE) Parse(line string, parts []string, comment string) (string, error)
- func (p *GlobalEE) PreParse(line string, parts, preComments []string, comment string) (string, error)
- func (p *GlobalEE) ResultAll() ([]common.ReturnResultLine, []string, error)
- func (p *GlobalEE) Set(data common.ParserData, index int) error
- func (p *GlobalEE) SetPreComments(preComment []string)
- type HTTPRequests
- func (p *HTTPRequests) Delete(index int) error
- func (p *HTTPRequests) Get(createIfNotExist bool) (common.ParserData, error)
- func (p *HTTPRequests) GetEEActions() []*EEHTTPRequestAction
- func (p *HTTPRequests) GetOne(index int) (common.ParserData, error)
- func (p *HTTPRequests) GetParserName() string
- func (p *HTTPRequests) GetPreComments() ([]string, error)
- func (p *HTTPRequests) Init()
- func (p *HTTPRequests) Insert(data common.ParserData, index int) error
- func (p *HTTPRequests) Parse(line string, parts []string, comment string) (string, error)
- func (p *HTTPRequests) PreParse(line string, parts, preComments []string, comment string) (string, error)
- func (p *HTTPRequests) ResultAll() ([]common.ReturnResultLine, []string, error)
- func (p *HTTPRequests) Set(data common.ParserData, index int) error
- func (p *HTTPRequests) SetPreComments(preComment []string)
- type HTTPRequestsData
- type HTTPResponses
- func (p *HTTPResponses) Delete(index int) error
- func (p *HTTPResponses) Get(createIfNotExist bool) (common.ParserData, error)
- func (p *HTTPResponses) GetEEActions() []*EEHTTPResponseAction
- func (p *HTTPResponses) GetOne(index int) (common.ParserData, error)
- func (p *HTTPResponses) GetParserName() string
- func (p *HTTPResponses) GetPreComments() ([]string, error)
- func (p *HTTPResponses) Init()
- func (p *HTTPResponses) Insert(data common.ParserData, index int) error
- func (p *HTTPResponses) Parse(line string, parts []string, comment string) (string, error)
- func (p *HTTPResponses) PreParse(line string, parts, preComments []string, comment string) (string, error)
- func (p *HTTPResponses) ResultAll() ([]common.ReturnResultLine, []string, error)
- func (p *HTTPResponses) Set(data common.ParserData, index int) error
- func (p *HTTPResponses) SetPreComments(preComment []string)
- type HTTPResponsesData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 (*Filters) Get ¶
func (p *Filters) Get(createIfNotExist bool) (common.ParserData, error)
Get returns all parsed data (both CE and EE filters).
func (*Filters) GetEEFilters ¶
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 ¶
GetParserName returns the parser name.
func (*Filters) GetPreComments ¶
GetPreComments returns pre-comments.
func (*Filters) Insert ¶
func (p *Filters) Insert(data common.ParserData, index int) error
Insert inserts data at index.
func (*Filters) Parse ¶
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 ¶
SetPreComments sets pre-comments.
type FiltersData ¶
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 (*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 ¶
GetParserName returns the parser name. Returns "global-ee" to avoid collision with standard global parsers.
func (*GlobalEE) GetPreComments ¶
GetPreComments returns pre-comments.
func (*GlobalEE) Insert ¶
func (p *GlobalEE) Insert(data common.ParserData, index int) error
Insert inserts data at index.
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 ¶
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) Insert ¶
func (p *HTTPRequests) Insert(data common.ParserData, index int) error
Insert inserts data at index.
func (*HTTPRequests) Parse ¶
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) Insert ¶
func (p *HTTPResponses) Insert(data common.ParserData, index int) error
Insert inserts data at index.
func (*HTTPResponses) Parse ¶
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.