directives

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package types provides parser implementations for HAProxy Enterprise Edition section-specific directives.

Each file in this package implements ParserInterface for directives within specific EE sections (udp-lb, waf-global, waf-profile, botmgmt-profile, captcha).

These parsers are used by the enterprise.Parser to extract directive values from EE sections, populating the corresponding API model fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotMgmtProfile

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

BotMgmtProfile parses botmgmt-profile section directives.

func NewBotMgmtProfile

func NewBotMgmtProfile() *BotMgmtProfile

NewBotMgmtProfile creates a new BotMgmtProfile parser.

func (*BotMgmtProfile) Delete

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

Delete deletes data at index.

func (*BotMgmtProfile) Get

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

Get returns parsed data.

func (*BotMgmtProfile) GetData

func (p *BotMgmtProfile) GetData() *BotMgmtProfileData

GetData returns the parsed bot management profile data.

func (*BotMgmtProfile) GetOne

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

GetOne returns parsed data at index.

func (*BotMgmtProfile) GetParserName

func (p *BotMgmtProfile) GetParserName() string

GetParserName returns the parser name.

func (*BotMgmtProfile) GetPreComments

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

GetPreComments returns pre-comments.

func (*BotMgmtProfile) Init

func (p *BotMgmtProfile) Init()

Init initializes the parser.

func (*BotMgmtProfile) Insert

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

Insert inserts data at index.

func (*BotMgmtProfile) Parse

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

Parse parses a botmgmt-profile directive line.

func (*BotMgmtProfile) PreParse

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

PreParse is called before Parse for preprocessor handling.

func (*BotMgmtProfile) ResultAll

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

ResultAll returns all results for serialization.

func (*BotMgmtProfile) Set

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

Set sets data at index.

func (*BotMgmtProfile) SetPreComments

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

SetPreComments sets pre-comments.

type BotMgmtProfileData

type BotMgmtProfileData struct {
	Name         string
	ScoreVersion int
	Track        string
	TrackPeers   string
}

BotMgmtProfileData holds parsed botmgmt-profile section data.

type Captcha

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

Captcha parses captcha section directives.

func NewCaptcha

func NewCaptcha() *Captcha

NewCaptcha creates a new Captcha parser.

func (*Captcha) Delete

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

Delete deletes data at index.

func (*Captcha) Get

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

Get returns parsed data.

func (*Captcha) GetData

func (p *Captcha) GetData() *CaptchaData

GetData returns the parsed captcha data.

func (*Captcha) GetOne

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

GetOne returns parsed data at index.

func (*Captcha) GetParserName

func (p *Captcha) GetParserName() string

GetParserName returns the parser name.

func (*Captcha) GetPreComments

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

GetPreComments returns pre-comments.

func (*Captcha) Init

func (p *Captcha) Init()

Init initializes the parser.

func (*Captcha) Insert

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

Insert inserts data at index.

func (*Captcha) Parse

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

Parse parses a captcha directive line.

func (*Captcha) PreParse

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

PreParse is called before Parse for preprocessor handling.

func (*Captcha) ResultAll

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

ResultAll returns all results for serialization.

func (*Captcha) Set

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

Set sets data at index.

func (*Captcha) SetPreComments

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

SetPreComments sets pre-comments.

type CaptchaData

type CaptchaData struct {
	Name      string
	Provider  string
	PublicKey string
	SecretKey string
	HTMLFile  string
}

CaptchaData holds parsed captcha section data.

type DynamicUpdate

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

DynamicUpdate parses dynamic-update section directives.

func NewDynamicUpdate

func NewDynamicUpdate() *DynamicUpdate

NewDynamicUpdate creates a new DynamicUpdate parser.

func (*DynamicUpdate) Delete

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

Delete deletes data at index.

func (*DynamicUpdate) Get

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

Get returns parsed data.

func (*DynamicUpdate) GetData

func (p *DynamicUpdate) GetData() *DynamicUpdateData

GetData returns the parsed dynamic update data.

func (*DynamicUpdate) GetOne

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

GetOne returns parsed data at index.

func (*DynamicUpdate) GetParserName

func (p *DynamicUpdate) GetParserName() string

GetParserName returns the parser name.

func (*DynamicUpdate) GetPreComments

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

GetPreComments returns pre-comments.

func (*DynamicUpdate) Init

func (p *DynamicUpdate) Init()

Init initializes the parser.

func (*DynamicUpdate) Insert

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

Insert inserts data at index.

func (*DynamicUpdate) Parse

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

Parse parses a dynamic-update directive line.

func (*DynamicUpdate) PreParse

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

PreParse is called before Parse for preprocessor handling.

func (*DynamicUpdate) ResultAll

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

ResultAll returns all results for serialization.

func (*DynamicUpdate) Set

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

Set sets data at index.

func (*DynamicUpdate) SetPreComments

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

SetPreComments sets pre-comments.

type DynamicUpdateData

type DynamicUpdateData struct {
	Name    string
	URL     string
	Delay   int
	Timeout int
	Map     string
}

DynamicUpdateData holds parsed dynamic-update section data.

type UDPLB

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

UDPLB parses udp-lb section directives.

func NewUDPLB

func NewUDPLB() *UDPLB

NewUDPLB creates a new UDPLB parser.

func (*UDPLB) Delete

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

Delete deletes data at index.

func (*UDPLB) Get

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

Get returns parsed data.

func (*UDPLB) GetData

func (p *UDPLB) GetData() *UDPLBData

GetData returns the parsed UDP LB data.

func (*UDPLB) GetOne

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

GetOne returns parsed data at index.

func (*UDPLB) GetParserName

func (p *UDPLB) GetParserName() string

GetParserName returns the parser name.

func (*UDPLB) GetPreComments

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

GetPreComments returns pre-comments.

func (*UDPLB) Init

func (p *UDPLB) Init()

Init initializes the parser.

func (*UDPLB) Insert

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

Insert inserts data at index.

func (*UDPLB) Parse

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

Parse parses a udp-lb directive line.

func (*UDPLB) PreParse

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

PreParse is called before Parse for preprocessor handling.

func (*UDPLB) ResultAll

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

ResultAll returns all results for serialization.

func (*UDPLB) Set

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

Set sets data at index.

func (*UDPLB) SetPreComments

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

SetPreComments sets pre-comments.

type UDPLBData

type UDPLBData struct {
	Name           string
	Balance        string
	ProxyRequests  int
	ProxyResponses int
}

UDPLBData holds parsed udp-lb section data.

type WAFGlobal

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

WAFGlobal parses waf-global section directives.

func NewWAFGlobal

func NewWAFGlobal() *WAFGlobal

NewWAFGlobal creates a new WAFGlobal parser.

func (*WAFGlobal) Delete

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

Delete deletes data at index.

func (*WAFGlobal) Get

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

Get returns parsed data.

func (*WAFGlobal) GetData

func (p *WAFGlobal) GetData() *WAFGlobalData

GetData returns the parsed WAF global data.

func (*WAFGlobal) GetOne

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

GetOne returns parsed data at index.

func (*WAFGlobal) GetParserName

func (p *WAFGlobal) GetParserName() string

GetParserName returns the parser name.

func (*WAFGlobal) GetPreComments

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

GetPreComments returns pre-comments.

func (*WAFGlobal) Init

func (p *WAFGlobal) Init()

Init initializes the parser.

func (*WAFGlobal) Insert

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

Insert inserts data at index.

func (*WAFGlobal) Parse

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

Parse parses a waf-global directive line.

func (*WAFGlobal) PreParse

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

PreParse is called before Parse for preprocessor handling.

func (*WAFGlobal) ResultAll

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

ResultAll returns all results for serialization.

func (*WAFGlobal) Set

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

Set sets data at index.

func (*WAFGlobal) SetPreComments

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

SetPreComments sets pre-comments.

type WAFGlobalData

type WAFGlobalData struct {
	RulesFile     string
	BodyLimit     int
	JSONLevels    int
	AnalyzerCache int
}

WAFGlobalData holds parsed waf-global section data.

type WAFProfile

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

WAFProfile parses waf-profile section directives.

func NewWAFProfile

func NewWAFProfile() *WAFProfile

NewWAFProfile creates a new WAFProfile parser.

func (*WAFProfile) Delete

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

Delete deletes data at index.

func (*WAFProfile) Get

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

Get returns parsed data.

func (*WAFProfile) GetData

func (p *WAFProfile) GetData() *WAFProfileData

GetData returns the parsed WAF profile data.

func (*WAFProfile) GetOne

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

GetOne returns parsed data at index.

func (*WAFProfile) GetParserName

func (p *WAFProfile) GetParserName() string

GetParserName returns the parser name.

func (*WAFProfile) GetPreComments

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

GetPreComments returns pre-comments.

func (*WAFProfile) Init

func (p *WAFProfile) Init()

Init initializes the parser.

func (*WAFProfile) Insert

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

Insert inserts data at index.

func (*WAFProfile) Parse

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

Parse parses a waf-profile directive line.

func (*WAFProfile) PreParse

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

PreParse is called before Parse for preprocessor handling.

func (*WAFProfile) ResultAll

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

ResultAll returns all results for serialization.

func (*WAFProfile) Set

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

Set sets data at index.

func (*WAFProfile) SetPreComments

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

SetPreComments sets pre-comments.

type WAFProfileData

type WAFProfileData struct {
	Name      string
	RulesFile string
	BodyLimit int
}

WAFProfileData holds parsed waf-profile section data.

Jump to

Keyboard shortcuts

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