Documentation
¶
Overview ¶
Package sections provides factory functions for creating HAProxy configuration operations.
This file contains generic CRUD builders that generate Create/Update/Delete operation factories from a single registration, eliminating repetitive boilerplate.
Package sections provides factory functions for creating HAProxy configuration operations.
These factory functions use generic operation types to eliminate repetitive boilerplate while maintaining type safety and compile-time verification.
Package sections provides factory functions for creating HAProxy Enterprise Edition operations.
This file contains factory functions for EE-only sections: - Bot Management Profiles (v3.0+ EE) - Captcha (v3.0+ EE) - WAF Profile (v3.2+ EE) - WAF Global (v3.2+ EE)
Package sections provides factory functions for creating HAProxy configuration operations.
This file contains helper functions to reduce repetition in factory functions.
Package sections provides generic operation types for HAProxy configuration management.
This file contains type-safe generic operation implementations that replace the repetitive per-section operation struct definitions. Each generic type handles a specific "shape" of API operation pattern.
Index ¶
- Constants
- func ACLName(a *models.ACL) string
- func AcmeProviderName(a *models.AcmeProvider) string
- func BackendName(b *models.Backend) string
- func BindName(b *models.Bind) string
- func BotMgmtProfileName(p *v32ee.BotmgmtProfile) string
- func CacheName(c *models.Cache) string
- func CaptchaEEName(c *v32ee.Captcha) string
- func CrtStoreName(c *models.CrtStore) string
- func DefaultsName(d *models.Defaults) string
- func DescribeACL(op OperationType, aclName, parentType, parentName string) func() string
- func DescribeContainerChild(op OperationType, childType, childName, containerType, containerName string) func() string
- func DescribeIndexChild(op OperationType, childType string, index int, parentType, parentName string) func() string
- func DescribeNamedChild(op OperationType, childType, childName, parentType, parentName string) func() string
- func DescribeSingleton(op OperationType, section string) func() string
- func DescribeTopLevel(op OperationType, section, name string) func() string
- func FCGIAppName(f *models.FCGIApp) string
- func FilterType(f *models.Filter) string
- func FrontendName(f *models.Frontend) string
- func HTTPErrorsSectionName(h *models.HTTPErrorsSection) string
- func Identity[T any](model T) T
- func LogForwardName(l *models.LogForward) string
- func LogProfileName(l *models.LogProfile) string
- func MailerEntryName(m *models.MailerEntry) string
- func MailersSectionName(m *models.MailersSection) string
- func NameserverName(n *models.Nameserver) string
- func Nil[T any](_ T) T
- func PeerEntryName(p *models.PeerEntry) string
- func PeerSectionName(p *models.PeerSection) string
- func ProgramName(p *models.Program) string
- func ResolverName(r *models.Resolver) string
- func RingName(r *models.Ring) string
- func ServerName(s *models.Server) string
- func ServerTemplateName(s *models.ServerTemplate) string
- func UserName(u *models.User) string
- func UserlistName(u *models.Userlist) string
- func WAFProfileName(p *v32ee.WafProfile) string
- type ContainerChildOp
- func (op *ContainerChildOp[TModel, TAPI]) Describe() string
- func (op *ContainerChildOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
- func (op *ContainerChildOp[TModel, TAPI]) Priority() int
- func (op *ContainerChildOp[TModel, TAPI]) Section() string
- func (op *ContainerChildOp[TModel, TAPI]) Type() OperationType
- type ExecuteContainerChildFunc
- type ExecuteIndexChildFunc
- type ExecuteNameChildFunc
- type ExecuteSingletonFunc
- type ExecuteTopLevelFunc
- type IndexChildCRUD
- type IndexChildOp
- func (op *IndexChildOp[TModel, TAPI]) Describe() string
- func (op *IndexChildOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
- func (op *IndexChildOp[TModel, TAPI]) Priority() int
- func (op *IndexChildOp[TModel, TAPI]) Section() string
- func (op *IndexChildOp[TModel, TAPI]) Type() OperationType
- type NameChildCRUD
- type NameChildOp
- func (op *NameChildOp[TModel, TAPI]) Describe() string
- func (op *NameChildOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
- func (op *NameChildOp[TModel, TAPI]) Priority() int
- func (op *NameChildOp[TModel, TAPI]) Section() string
- func (op *NameChildOp[TModel, TAPI]) Type() OperationType
- type Operation
- func NewACLBackendCreate(backendName string, acl *models.ACL, index int) Operation
- func NewACLBackendDelete(backendName string, acl *models.ACL, index int) Operation
- func NewACLBackendUpdate(backendName string, acl *models.ACL, index int) Operation
- func NewACLFrontendCreate(frontendName string, acl *models.ACL, index int) Operation
- func NewACLFrontendDelete(frontendName string, acl *models.ACL, index int) Operation
- func NewACLFrontendUpdate(frontendName string, acl *models.ACL, index int) Operation
- func NewAcmeProviderCreate(acmeProvider *models.AcmeProvider) Operation
- func NewAcmeProviderDelete(acmeProvider *models.AcmeProvider) Operation
- func NewAcmeProviderUpdate(acmeProvider *models.AcmeProvider) Operation
- func NewBackendCreate(backend *models.Backend) Operation
- func NewBackendDelete(backend *models.Backend) Operation
- func NewBackendSwitchingRuleFrontendCreate(frontendName string, rule *models.BackendSwitchingRule, index int) Operation
- func NewBackendSwitchingRuleFrontendDelete(frontendName string, rule *models.BackendSwitchingRule, index int) Operation
- func NewBackendSwitchingRuleFrontendUpdate(frontendName string, rule *models.BackendSwitchingRule, index int) Operation
- func NewBackendUpdate(backend *models.Backend) Operation
- func NewBindFrontendCreate(frontendName, bindName string, bind *models.Bind) Operation
- func NewBindFrontendDelete(frontendName, bindName string, bind *models.Bind) Operation
- func NewBindFrontendUpdate(frontendName, bindName string, bind *models.Bind) Operation
- func NewBotMgmtProfileCreate(profile *v32ee.BotmgmtProfile) Operation
- func NewBotMgmtProfileDelete(profile *v32ee.BotmgmtProfile) Operation
- func NewBotMgmtProfileUpdate(profile *v32ee.BotmgmtProfile) Operation
- func NewCacheCreate(cache *models.Cache) Operation
- func NewCacheDelete(cache *models.Cache) Operation
- func NewCacheUpdate(cache *models.Cache) Operation
- func NewCaptchaCreate(captcha *v32ee.Captcha) Operation
- func NewCaptchaDelete(captcha *v32ee.Captcha) Operation
- func NewCaptchaUpdate(captcha *v32ee.Captcha) Operation
- func NewCaptureFrontendCreate(frontendName string, capture *models.Capture, index int) Operation
- func NewCaptureFrontendDelete(frontendName string, capture *models.Capture, index int) Operation
- func NewCaptureFrontendUpdate(frontendName string, capture *models.Capture, index int) Operation
- func NewCrtStoreCreate(crtStore *models.CrtStore) Operation
- func NewCrtStoreDelete(crtStore *models.CrtStore) Operation
- func NewCrtStoreUpdate(crtStore *models.CrtStore) Operation
- func NewDefaultsCreate(defaults *models.Defaults) Operation
- func NewDefaultsDelete(defaults *models.Defaults) Operation
- func NewDefaultsUpdate(defaults *models.Defaults) Operation
- func NewFCGIAppCreate(fcgiApp *models.FCGIApp) Operation
- func NewFCGIAppDelete(fcgiApp *models.FCGIApp) Operation
- func NewFCGIAppUpdate(fcgiApp *models.FCGIApp) Operation
- func NewFilterBackendCreate(backendName string, filter *models.Filter, index int) Operation
- func NewFilterBackendDelete(backendName string, filter *models.Filter, index int) Operation
- func NewFilterBackendUpdate(backendName string, filter *models.Filter, index int) Operation
- func NewFilterFrontendCreate(frontendName string, filter *models.Filter, index int) Operation
- func NewFilterFrontendDelete(frontendName string, filter *models.Filter, index int) Operation
- func NewFilterFrontendUpdate(frontendName string, filter *models.Filter, index int) Operation
- func NewFrontendCreate(frontend *models.Frontend) Operation
- func NewFrontendDelete(frontend *models.Frontend) Operation
- func NewFrontendUpdate(frontend *models.Frontend) Operation
- func NewGlobalUpdate(global *models.Global) Operation
- func NewHTTPAfterResponseRuleBackendCreate(backendName string, rule *models.HTTPAfterResponseRule, index int) Operation
- func NewHTTPAfterResponseRuleBackendDelete(backendName string, rule *models.HTTPAfterResponseRule, index int) Operation
- func NewHTTPAfterResponseRuleBackendUpdate(backendName string, rule *models.HTTPAfterResponseRule, index int) Operation
- func NewHTTPCheckBackendCreate(backendName string, check *models.HTTPCheck, index int) Operation
- func NewHTTPCheckBackendDelete(backendName string, check *models.HTTPCheck, index int) Operation
- func NewHTTPCheckBackendUpdate(backendName string, check *models.HTTPCheck, index int) Operation
- func NewHTTPErrorsSectionCreate(section *models.HTTPErrorsSection) Operation
- func NewHTTPErrorsSectionDelete(section *models.HTTPErrorsSection) Operation
- func NewHTTPErrorsSectionUpdate(section *models.HTTPErrorsSection) Operation
- func NewHTTPRequestRuleBackendCreate(backendName string, rule *models.HTTPRequestRule, index int) Operation
- func NewHTTPRequestRuleBackendDelete(backendName string, rule *models.HTTPRequestRule, index int) Operation
- func NewHTTPRequestRuleBackendUpdate(backendName string, rule *models.HTTPRequestRule, index int) Operation
- func NewHTTPRequestRuleFrontendCreate(frontendName string, rule *models.HTTPRequestRule, index int) Operation
- func NewHTTPRequestRuleFrontendDelete(frontendName string, rule *models.HTTPRequestRule, index int) Operation
- func NewHTTPRequestRuleFrontendUpdate(frontendName string, rule *models.HTTPRequestRule, index int) Operation
- func NewHTTPResponseRuleBackendCreate(backendName string, rule *models.HTTPResponseRule, index int) Operation
- func NewHTTPResponseRuleBackendDelete(backendName string, rule *models.HTTPResponseRule, index int) Operation
- func NewHTTPResponseRuleBackendUpdate(backendName string, rule *models.HTTPResponseRule, index int) Operation
- func NewHTTPResponseRuleFrontendCreate(frontendName string, rule *models.HTTPResponseRule, index int) Operation
- func NewHTTPResponseRuleFrontendDelete(frontendName string, rule *models.HTTPResponseRule, index int) Operation
- func NewHTTPResponseRuleFrontendUpdate(frontendName string, rule *models.HTTPResponseRule, index int) Operation
- func NewLogForwardCreate(logForward *models.LogForward) Operation
- func NewLogForwardDelete(logForward *models.LogForward) Operation
- func NewLogForwardUpdate(logForward *models.LogForward) Operation
- func NewLogProfileCreate(logProfile *models.LogProfile) Operation
- func NewLogProfileDelete(logProfile *models.LogProfile) Operation
- func NewLogProfileUpdate(logProfile *models.LogProfile) Operation
- func NewLogTargetBackendCreate(backendName string, logTarget *models.LogTarget, index int) Operation
- func NewLogTargetBackendDelete(backendName string, logTarget *models.LogTarget, index int) Operation
- func NewLogTargetBackendUpdate(backendName string, logTarget *models.LogTarget, index int) Operation
- func NewLogTargetFrontendCreate(frontendName string, logTarget *models.LogTarget, index int) Operation
- func NewLogTargetFrontendDelete(frontendName string, logTarget *models.LogTarget, index int) Operation
- func NewLogTargetFrontendUpdate(frontendName string, logTarget *models.LogTarget, index int) Operation
- func NewMailerEntryCreate(mailersName string, entry *models.MailerEntry) Operation
- func NewMailerEntryDelete(mailersName string, entry *models.MailerEntry) Operation
- func NewMailerEntryUpdate(mailersName string, entry *models.MailerEntry) Operation
- func NewMailersSectionCreate(section *models.MailersSection) Operation
- func NewMailersSectionDelete(section *models.MailersSection) Operation
- func NewMailersSectionUpdate(section *models.MailersSection) Operation
- func NewNameserverCreate(resolverName string, nameserver *models.Nameserver) Operation
- func NewNameserverDelete(resolverName string, nameserver *models.Nameserver) Operation
- func NewNameserverUpdate(resolverName string, nameserver *models.Nameserver) Operation
- func NewPeerEntryCreate(peerSectionName string, entry *models.PeerEntry) Operation
- func NewPeerEntryDelete(peerSectionName string, entry *models.PeerEntry) Operation
- func NewPeerEntryUpdate(peerSectionName string, entry *models.PeerEntry) Operation
- func NewPeerSectionCreate(section *models.PeerSection) Operation
- func NewPeerSectionDelete(section *models.PeerSection) Operation
- func NewPeerSectionUpdate(section *models.PeerSection) Operation
- func NewProgramCreate(program *models.Program) Operation
- func NewProgramDelete(program *models.Program) Operation
- func NewProgramUpdate(program *models.Program) Operation
- func NewQUICInitialRuleDefaultsCreate(defaultsName string, rule *models.QUICInitialRule, index int) Operation
- func NewQUICInitialRuleDefaultsDelete(defaultsName string, rule *models.QUICInitialRule, index int) Operation
- func NewQUICInitialRuleDefaultsUpdate(defaultsName string, rule *models.QUICInitialRule, index int) Operation
- func NewQUICInitialRuleFrontendCreate(frontendName string, rule *models.QUICInitialRule, index int) Operation
- func NewQUICInitialRuleFrontendDelete(frontendName string, rule *models.QUICInitialRule, index int) Operation
- func NewQUICInitialRuleFrontendUpdate(frontendName string, rule *models.QUICInitialRule, index int) Operation
- func NewResolverCreate(resolver *models.Resolver) Operation
- func NewResolverDelete(resolver *models.Resolver) Operation
- func NewResolverUpdate(resolver *models.Resolver) Operation
- func NewRingCreate(ring *models.Ring) Operation
- func NewRingDelete(ring *models.Ring) Operation
- func NewRingUpdate(ring *models.Ring) Operation
- func NewServerCreate(backendName string, server *models.Server) Operation
- func NewServerDelete(backendName string, server *models.Server) Operation
- func NewServerSwitchingRuleBackendCreate(backendName string, rule *models.ServerSwitchingRule, index int) Operation
- func NewServerSwitchingRuleBackendDelete(backendName string, rule *models.ServerSwitchingRule, index int) Operation
- func NewServerSwitchingRuleBackendUpdate(backendName string, rule *models.ServerSwitchingRule, index int) Operation
- func NewServerTemplateCreate(backendName string, serverTemplate *models.ServerTemplate) Operation
- func NewServerTemplateDelete(backendName string, serverTemplate *models.ServerTemplate) Operation
- func NewServerTemplateUpdate(backendName string, serverTemplate *models.ServerTemplate) Operation
- func NewServerUpdate(backendName string, server *models.Server) Operation
- func NewStickRuleBackendCreate(backendName string, rule *models.StickRule, index int) Operation
- func NewStickRuleBackendDelete(backendName string, rule *models.StickRule, index int) Operation
- func NewStickRuleBackendUpdate(backendName string, rule *models.StickRule, index int) Operation
- func NewTCPCheckBackendCreate(backendName string, check *models.TCPCheck, index int) Operation
- func NewTCPCheckBackendDelete(backendName string, check *models.TCPCheck, index int) Operation
- func NewTCPCheckBackendUpdate(backendName string, check *models.TCPCheck, index int) Operation
- func NewTCPRequestRuleBackendCreate(backendName string, rule *models.TCPRequestRule, index int) Operation
- func NewTCPRequestRuleBackendDelete(backendName string, rule *models.TCPRequestRule, index int) Operation
- func NewTCPRequestRuleBackendUpdate(backendName string, rule *models.TCPRequestRule, index int) Operation
- func NewTCPRequestRuleFrontendCreate(frontendName string, rule *models.TCPRequestRule, index int) Operation
- func NewTCPRequestRuleFrontendDelete(frontendName string, rule *models.TCPRequestRule, index int) Operation
- func NewTCPRequestRuleFrontendUpdate(frontendName string, rule *models.TCPRequestRule, index int) Operation
- func NewTCPResponseRuleBackendCreate(backendName string, rule *models.TCPResponseRule, index int) Operation
- func NewTCPResponseRuleBackendDelete(backendName string, rule *models.TCPResponseRule, index int) Operation
- func NewTCPResponseRuleBackendUpdate(backendName string, rule *models.TCPResponseRule, index int) Operation
- func NewTracesUpdate(traces *models.Traces) Operation
- func NewUserCreate(userlistName string, user *models.User) Operation
- func NewUserDelete(userlistName string, user *models.User) Operation
- func NewUserUpdate(userlistName string, user *models.User) Operation
- func NewUserlistCreate(userlist *models.Userlist) Operation
- func NewUserlistDelete(userlist *models.Userlist) Operation
- func NewWAFGlobalCreate(wafGlobal *v32ee.WafGlobal) Operation
- func NewWAFGlobalDelete(wafGlobal *v32ee.WafGlobal) Operation
- func NewWAFGlobalUpdate(wafGlobal *v32ee.WafGlobal) Operation
- func NewWAFProfileCreate(profile *v32ee.WafProfile) Operation
- func NewWAFProfileDelete(profile *v32ee.WafProfile) Operation
- func NewWAFProfileUpdate(profile *v32ee.WafProfile) Operation
- type OperationType
- type RuntimeReloadTracker
- type ServerUpdateOp
- func (op *ServerUpdateOp) BackendName() string
- func (op *ServerUpdateOp) Describe() string
- func (op *ServerUpdateOp) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
- func (op *ServerUpdateOp) Priority() int
- func (op *ServerUpdateOp) Section() string
- func (op *ServerUpdateOp) Server() *models.Server
- func (op *ServerUpdateOp) ServerName() string
- func (op *ServerUpdateOp) TriggeredReload() bool
- func (op *ServerUpdateOp) Type() OperationType
- type SingletonOp
- func (op *SingletonOp[TModel, TAPI]) Describe() string
- func (op *SingletonOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
- func (op *SingletonOp[TModel, TAPI]) Priority() int
- func (op *SingletonOp[TModel, TAPI]) Section() string
- func (op *SingletonOp[TModel, TAPI]) Type() OperationType
- type TopLevelCRUD
- type TopLevelOp
- func (op *TopLevelOp[TModel, TAPI]) Describe() string
- func (op *TopLevelOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
- func (op *TopLevelOp[TModel, TAPI]) Priority() int
- func (op *TopLevelOp[TModel, TAPI]) Section() string
- func (op *TopLevelOp[TModel, TAPI]) Type() OperationType
Constants ¶
const ( // PriorityEEBotMgmtProfile is the priority for bot management profile operations. // These are top-level EE sections, similar to resolvers and caches. PriorityEEBotMgmtProfile = 15 // PriorityEECaptcha is the priority for captcha operations. PriorityEECaptcha = 15 // PriorityEEWAFGlobal is the priority for WAF global operations. // WAF global should be created before WAF profiles. PriorityEEWAFGlobal = 12 // PriorityEEWAFProfile is the priority for WAF profile operations. PriorityEEWAFProfile = 15 )
Priority constants for Enterprise Edition sections.
const ( // Priority 10 - Top-level sections that must exist first. PriorityGlobal = 10 PriorityDefaults = 20 PriorityUserlist = 10 PriorityCrtStore = 10 PriorityLogForward = 10 PriorityFCGIApp = 10 PriorityProgram = 10 // Priority 15 - Container sections. PriorityPeer = 15 PriorityRing = 15 PriorityMailers = 15 PriorityUser = 15 PriorityCache = 15 PriorityResolver = 15 // Priority 15 - Observability sections (v3.1+ features). PriorityLogProfile = 15 PriorityTraces = 15 // Priority 15 - Certificate automation sections (v3.2+ features). PriorityAcmeProvider = 15 // Priority 20-25 - HTTP errors and other mid-level. PriorityHTTPErrors = 25 // Priority 30 - Frontend/Backend sections. PriorityFrontend = 30 PriorityBackend = 30 // Priority 40 - Direct children of frontends/backends. PriorityBind = 40 PriorityServer = 40 PriorityMailerEntry = 40 PriorityPeerEntry = 40 PriorityNameserver = 40 // Priority 50 - ACLs. PriorityACL = 50 // Priority 60 - Rules (depend on ACLs). PriorityRule = 60 PriorityCapture = 60 PriorityStickRule = 60 PriorityHTTPAfterRule = 60 PriorityServerSwitchingRule = 60 PriorityBackendSwitchingRule = 60 PriorityHTTPCheck = 60 PriorityLogTarget = 60 PriorityTCPCheck = 60 PriorityFilter = 60 PriorityQUICInitialRule = 60 // v3.1+ only )
Priority constants for operation ordering (base priorities, before multiplier). Lower priority = executed first for Creates, executed last for Deletes. Higher priority = executed last for Creates, executed first for Deletes. Note: Effective priority = BasePriority * PriorityMultiplier (+ index adjustment for IndexChildOp).
const PriorityMultiplier = 1000
PriorityMultiplier is used to create sub-priority space for index-based operations. All operation types multiply their base priority by this value to create effective priorities. For IndexChildOp, the index is added (for creates) or subtracted from 999 (for deletes) to ensure correct ordering within the same base priority level.
Variables ¶
This section is empty.
Functions ¶
func AcmeProviderName ¶
func AcmeProviderName(a *models.AcmeProvider) string
AcmeProviderName extracts the name from an AcmeProvider model.
func BackendName ¶
BackendName extracts the name from a Backend model.
func BotMgmtProfileName ¶
func BotMgmtProfileName(p *v32ee.BotmgmtProfile) string
BotMgmtProfileName extracts the name from a BotmgmtProfile model.
func CaptchaEEName ¶
CaptchaEEName extracts the name from a Captcha model. Named CaptchaEEName to avoid conflict with CaptchaName in helpers.go.
func CrtStoreName ¶
CrtStoreName extracts the name from a CrtStore model.
func DefaultsName ¶
DefaultsName extracts the name from a Defaults model.
func DescribeACL ¶
func DescribeACL(op OperationType, aclName, parentType, parentName string) func() string
DescribeACL returns a description function for ACL operations with ACL name.
func DescribeContainerChild ¶
func DescribeContainerChild(op OperationType, childType, childName, containerType, containerName string) func() string
DescribeContainerChild returns a description function for container child operations.
func DescribeIndexChild ¶
func DescribeIndexChild(op OperationType, childType string, index int, parentType, parentName string) func() string
DescribeIndexChild returns a description function for indexed child operations.
func DescribeNamedChild ¶
func DescribeNamedChild(op OperationType, childType, childName, parentType, parentName string) func() string
DescribeNamedChild returns a description function for named child operations.
func DescribeSingleton ¶
func DescribeSingleton(op OperationType, section string) func() string
DescribeSingleton returns a description function for singleton operations.
func DescribeTopLevel ¶
func DescribeTopLevel(op OperationType, section, name string) func() string
DescribeTopLevel returns a description function for top-level operations.
func FCGIAppName ¶
FCGIAppName extracts the name from an FCGIApp model.
func FilterType ¶
FilterType extracts the type from a Filter model (for description purposes).
func FrontendName ¶
FrontendName extracts the name from a Frontend model.
func HTTPErrorsSectionName ¶
func HTTPErrorsSectionName(h *models.HTTPErrorsSection) string
HTTPErrorsSectionName extracts the name from an HTTPErrorsSection model.
func Identity ¶
func Identity[T any](model T) T
Identity returns the model as-is. Used as transform function for create/update operations.
func LogForwardName ¶
func LogForwardName(l *models.LogForward) string
LogForwardName extracts the name from a LogForward model.
func LogProfileName ¶
func LogProfileName(l *models.LogProfile) string
LogProfileName extracts the name from a LogProfile model.
func MailerEntryName ¶
func MailerEntryName(m *models.MailerEntry) string
MailerEntryName extracts the name from a MailerEntry model.
func MailersSectionName ¶
func MailersSectionName(m *models.MailersSection) string
MailersSectionName extracts the name from a MailersSection model.
func NameserverName ¶
func NameserverName(n *models.Nameserver) string
NameserverName extracts the name from a Nameserver model.
func Nil ¶
func Nil[T any](_ T) T
Nil returns the zero value of T. Used as transform function for delete operations where the model isn't needed.
func PeerEntryName ¶
PeerEntryName extracts the name from a PeerEntry model.
func PeerSectionName ¶
func PeerSectionName(p *models.PeerSection) string
PeerSectionName extracts the name from a PeerSection model.
func ProgramName ¶
ProgramName extracts the name from a Program model.
func ResolverName ¶
ResolverName extracts the name from a Resolver model.
func ServerName ¶
ServerName extracts the name from a Server model.
func ServerTemplateName ¶
func ServerTemplateName(s *models.ServerTemplate) string
ServerTemplateName extracts the prefix from a ServerTemplate model.
func UserlistName ¶
UserlistName extracts the name from a Userlist model.
func WAFProfileName ¶
func WAFProfileName(p *v32ee.WafProfile) string
WAFProfileName extracts the name from a WafProfile model.
Types ¶
type ContainerChildOp ¶
ContainerChildOp handles operations for container child resources like user, mailer_entry. These resources belong to a container (userlist, mailers) where the parent is passed via params.
func NewContainerChildOp ¶
func NewContainerChildOp[TModel any, TAPI any]( opType OperationType, sectionName string, priority int, containerName string, model TModel, transformFn func(TModel) TAPI, nameFn func(TModel) string, executeFn ExecuteContainerChildFunc[TAPI], describeFn func() string, ) *ContainerChildOp[TModel, TAPI]
NewContainerChildOp creates a new container child operation.
func (*ContainerChildOp[TModel, TAPI]) Describe ¶
func (op *ContainerChildOp[TModel, TAPI]) Describe() string
func (*ContainerChildOp[TModel, TAPI]) Execute ¶
func (op *ContainerChildOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
func (*ContainerChildOp[TModel, TAPI]) Priority ¶
func (op *ContainerChildOp[TModel, TAPI]) Priority() int
Priority returns the effective priority. Uses multiplier for compatibility with IndexChildOp.
func (*ContainerChildOp[TModel, TAPI]) Section ¶
func (op *ContainerChildOp[TModel, TAPI]) Section() string
func (*ContainerChildOp[TModel, TAPI]) Type ¶
func (op *ContainerChildOp[TModel, TAPI]) Type() OperationType
type ExecuteContainerChildFunc ¶
type ExecuteContainerChildFunc[TAPI any] func( ctx context.Context, c *client.DataplaneClient, txID string, containerName string, childName string, model TAPI, ) error
ExecuteContainerChildFunc is the function signature for container child operations. Used by user, mailer_entry, peer_entry, nameserver where parent is in params.
type ExecuteIndexChildFunc ¶
type ExecuteIndexChildFunc[TAPI any] func( ctx context.Context, c *client.DataplaneClient, txID string, parent string, index int, model TAPI, ) error
ExecuteIndexChildFunc is the function signature for index-based child operations. Used by ACL, HTTP rules, TCP rules, filters, etc.
type ExecuteNameChildFunc ¶
type ExecuteNameChildFunc[TAPI any] func( ctx context.Context, c *client.DataplaneClient, txID string, parent string, childName string, model TAPI, ) error
ExecuteNameChildFunc is the function signature for name-based child operations. Used by bind, server_template.
type ExecuteSingletonFunc ¶
type ExecuteSingletonFunc[TAPI any] func( ctx context.Context, c *client.DataplaneClient, txID string, model TAPI, ) error
ExecuteSingletonFunc is the function signature for singleton operations. Used by global section which only supports update.
type ExecuteTopLevelFunc ¶
type ExecuteTopLevelFunc[TAPI any] func( ctx context.Context, c *client.DataplaneClient, txID string, model TAPI, name string, ) error
ExecuteTopLevelFunc is the function signature for top-level resource operations. Used by backend, frontend, defaults, cache, etc.
type IndexChildCRUD ¶
type IndexChildCRUD[T any] struct { Create func(parentName string, index int, model T) Operation Update func(parentName string, index int, model T) Operation Delete func(parentName string, index int, model T) Operation }
IndexChildCRUD holds pre-built Create/Update/Delete factory functions for an index-based child resource.
func NewIndexChildCRUD ¶
func NewIndexChildCRUD[T any]( section, childType, parentType string, priority int, createExec, updateExec, deleteExec ExecuteIndexChildFunc[T], ) IndexChildCRUD[T]
NewIndexChildCRUD creates a CRUD builder for an index-based child resource (ACL, HTTP rules, etc.). The childType is used in operation descriptions (e.g. "ACL", "HTTP request rule").
type IndexChildOp ¶
IndexChildOp handles operations for index-based child resources like ACL, HTTP rules, TCP rules. These resources belong to a parent (frontend/backend) and are identified by index position.
func NewIndexChildOp ¶
func NewIndexChildOp[TModel any, TAPI any]( opType OperationType, sectionName string, priority int, parentName string, index int, model TModel, transformFn func(TModel) TAPI, executeFn ExecuteIndexChildFunc[TAPI], describeFn func() string, ) *IndexChildOp[TModel, TAPI]
NewIndexChildOp creates a new index-based child operation.
func (*IndexChildOp[TModel, TAPI]) Describe ¶
func (op *IndexChildOp[TModel, TAPI]) Describe() string
func (*IndexChildOp[TModel, TAPI]) Execute ¶
func (op *IndexChildOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
func (*IndexChildOp[TModel, TAPI]) Priority ¶
func (op *IndexChildOp[TModel, TAPI]) Priority() int
Priority returns the effective priority incorporating the index for correct ordering. For creates: lower indexes run first (index 0 before index 1). For deletes: higher indexes run first (index 1 before index 0). This ensures index-based operations execute in the correct order even with parallel execution.
func (*IndexChildOp[TModel, TAPI]) Section ¶
func (op *IndexChildOp[TModel, TAPI]) Section() string
func (*IndexChildOp[TModel, TAPI]) Type ¶
func (op *IndexChildOp[TModel, TAPI]) Type() OperationType
type NameChildCRUD ¶
type NameChildCRUD[T any] struct { Create func(parentName string, model T) Operation Update func(parentName string, model T) Operation Delete func(parentName string, model T) Operation }
NameChildCRUD holds pre-built Create/Update/Delete factory functions for a name-based child resource.
func NewNameChildCRUD ¶
func NewNameChildCRUD[T any]( section, childType, parentType string, priority int, nameFn func(T) string, createExec, updateExec, deleteExec ExecuteNameChildFunc[T], ) NameChildCRUD[T]
NewNameChildCRUD creates a CRUD builder for a name-based child resource (bind, server template). The childType and parentType are used in operation descriptions.
type NameChildOp ¶
NameChildOp handles operations for name-based child resources like bind, server_template. These resources belong to a parent and are identified by name (not index).
func NewNameChildOp ¶
func NewNameChildOp[TModel any, TAPI any]( opType OperationType, sectionName string, priority int, parentName string, childName string, model TModel, transformFn func(TModel) TAPI, executeFn ExecuteNameChildFunc[TAPI], describeFn func() string, ) *NameChildOp[TModel, TAPI]
NewNameChildOp creates a new name-based child operation.
func (*NameChildOp[TModel, TAPI]) Describe ¶
func (op *NameChildOp[TModel, TAPI]) Describe() string
func (*NameChildOp[TModel, TAPI]) Execute ¶
func (op *NameChildOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
func (*NameChildOp[TModel, TAPI]) Priority ¶
func (op *NameChildOp[TModel, TAPI]) Priority() int
Priority returns the effective priority. Uses multiplier for compatibility with IndexChildOp.
func (*NameChildOp[TModel, TAPI]) Section ¶
func (op *NameChildOp[TModel, TAPI]) Section() string
func (*NameChildOp[TModel, TAPI]) Type ¶
func (op *NameChildOp[TModel, TAPI]) Type() OperationType
type Operation ¶
type Operation interface {
// Type returns the operation type (Create, Update, Delete)
Type() OperationType
// Section returns the configuration section this operation affects
Section() string
// Priority returns the execution priority (lower = first for creates, higher = first for deletes)
Priority() int
// Execute performs the operation via the Dataplane API
Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
// Describe returns a human-readable description of the operation
Describe() string
}
Operation defines the interface for all HAProxy configuration operations. This interface is implemented by all generic operation types (TopLevelOp, IndexChildOp, etc.)
func NewACLBackendCreate ¶
NewACLBackendCreate creates an operation to create an ACL in a backend.
func NewACLBackendDelete ¶
NewACLBackendDelete creates an operation to delete an ACL from a backend.
func NewACLBackendUpdate ¶
NewACLBackendUpdate creates an operation to update an ACL in a backend.
func NewACLFrontendCreate ¶
NewACLFrontendCreate creates an operation to create an ACL in a frontend.
func NewACLFrontendDelete ¶
NewACLFrontendDelete creates an operation to delete an ACL from a frontend.
func NewACLFrontendUpdate ¶
NewACLFrontendUpdate creates an operation to update an ACL in a frontend.
func NewAcmeProviderCreate ¶
func NewAcmeProviderCreate(acmeProvider *models.AcmeProvider) Operation
NewAcmeProviderCreate creates an operation to create an acme section.
func NewAcmeProviderDelete ¶
func NewAcmeProviderDelete(acmeProvider *models.AcmeProvider) Operation
NewAcmeProviderDelete creates an operation to delete an acme section.
func NewAcmeProviderUpdate ¶
func NewAcmeProviderUpdate(acmeProvider *models.AcmeProvider) Operation
NewAcmeProviderUpdate creates an operation to update an acme section.
func NewBackendCreate ¶
NewBackendCreate creates an operation to create a backend.
func NewBackendDelete ¶
NewBackendDelete creates an operation to delete a backend.
func NewBackendSwitchingRuleFrontendCreate ¶
func NewBackendSwitchingRuleFrontendCreate(frontendName string, rule *models.BackendSwitchingRule, index int) Operation
NewBackendSwitchingRuleFrontendCreate creates an operation to create a backend switching rule.
func NewBackendSwitchingRuleFrontendDelete ¶
func NewBackendSwitchingRuleFrontendDelete(frontendName string, rule *models.BackendSwitchingRule, index int) Operation
NewBackendSwitchingRuleFrontendDelete creates an operation to delete a backend switching rule.
func NewBackendSwitchingRuleFrontendUpdate ¶
func NewBackendSwitchingRuleFrontendUpdate(frontendName string, rule *models.BackendSwitchingRule, index int) Operation
NewBackendSwitchingRuleFrontendUpdate creates an operation to update a backend switching rule.
func NewBackendUpdate ¶
NewBackendUpdate creates an operation to update a backend.
func NewBindFrontendCreate ¶
NewBindFrontendCreate creates an operation to create a bind in a frontend.
func NewBindFrontendDelete ¶
NewBindFrontendDelete creates an operation to delete a bind from a frontend.
func NewBindFrontendUpdate ¶
NewBindFrontendUpdate creates an operation to update a bind in a frontend.
func NewBotMgmtProfileCreate ¶
func NewBotMgmtProfileCreate(profile *v32ee.BotmgmtProfile) Operation
NewBotMgmtProfileCreate creates an operation to create a bot management profile. Bot management profiles are only available in HAProxy Enterprise Edition.
func NewBotMgmtProfileDelete ¶
func NewBotMgmtProfileDelete(profile *v32ee.BotmgmtProfile) Operation
NewBotMgmtProfileDelete creates an operation to delete a bot management profile.
func NewBotMgmtProfileUpdate ¶
func NewBotMgmtProfileUpdate(profile *v32ee.BotmgmtProfile) Operation
NewBotMgmtProfileUpdate creates an operation to update a bot management profile.
func NewCacheCreate ¶
NewCacheCreate creates an operation to create a cache section.
func NewCacheDelete ¶
NewCacheDelete creates an operation to delete a cache section.
func NewCacheUpdate ¶
NewCacheUpdate creates an operation to update a cache section.
func NewCaptchaCreate ¶
NewCaptchaCreate creates an operation to create a captcha section. Captcha is only available in HAProxy Enterprise Edition.
func NewCaptchaDelete ¶
NewCaptchaDelete creates an operation to delete a captcha section.
func NewCaptchaUpdate ¶
NewCaptchaUpdate creates an operation to update a captcha section.
func NewCaptureFrontendCreate ¶
NewCaptureFrontendCreate creates an operation to create a capture declaration in a frontend.
func NewCaptureFrontendDelete ¶
NewCaptureFrontendDelete creates an operation to delete a capture declaration from a frontend.
func NewCaptureFrontendUpdate ¶
NewCaptureFrontendUpdate creates an operation to update a capture declaration in a frontend.
func NewCrtStoreCreate ¶
NewCrtStoreCreate creates an operation to create a crt-store section.
func NewCrtStoreDelete ¶
NewCrtStoreDelete creates an operation to delete a crt-store section.
func NewCrtStoreUpdate ¶
NewCrtStoreUpdate creates an operation to update a crt-store section.
func NewDefaultsCreate ¶
NewDefaultsCreate creates an operation to create a defaults section.
func NewDefaultsDelete ¶
NewDefaultsDelete creates an operation to delete a defaults section.
func NewDefaultsUpdate ¶
NewDefaultsUpdate creates an operation to update a defaults section.
func NewFCGIAppCreate ¶
NewFCGIAppCreate creates an operation to create a fcgi-app section.
func NewFCGIAppDelete ¶
NewFCGIAppDelete creates an operation to delete a fcgi-app section.
func NewFCGIAppUpdate ¶
NewFCGIAppUpdate creates an operation to update a fcgi-app section.
func NewFilterBackendCreate ¶
NewFilterBackendCreate creates an operation to create a filter in a backend.
func NewFilterBackendDelete ¶
NewFilterBackendDelete creates an operation to delete a filter from a backend.
func NewFilterBackendUpdate ¶
NewFilterBackendUpdate creates an operation to update a filter in a backend.
func NewFilterFrontendCreate ¶
NewFilterFrontendCreate creates an operation to create a filter in a frontend.
func NewFilterFrontendDelete ¶
NewFilterFrontendDelete creates an operation to delete a filter from a frontend.
func NewFilterFrontendUpdate ¶
NewFilterFrontendUpdate creates an operation to update a filter in a frontend.
func NewFrontendCreate ¶
NewFrontendCreate creates an operation to create a frontend.
func NewFrontendDelete ¶
NewFrontendDelete creates an operation to delete a frontend.
func NewFrontendUpdate ¶
NewFrontendUpdate creates an operation to update a frontend.
func NewGlobalUpdate ¶
NewGlobalUpdate creates an operation to update the global section.
func NewHTTPAfterResponseRuleBackendCreate ¶
func NewHTTPAfterResponseRuleBackendCreate(backendName string, rule *models.HTTPAfterResponseRule, index int) Operation
NewHTTPAfterResponseRuleBackendCreate creates an operation to create an HTTP after-response rule in a backend.
func NewHTTPAfterResponseRuleBackendDelete ¶
func NewHTTPAfterResponseRuleBackendDelete(backendName string, rule *models.HTTPAfterResponseRule, index int) Operation
NewHTTPAfterResponseRuleBackendDelete creates an operation to delete an HTTP after-response rule from a backend.
func NewHTTPAfterResponseRuleBackendUpdate ¶
func NewHTTPAfterResponseRuleBackendUpdate(backendName string, rule *models.HTTPAfterResponseRule, index int) Operation
NewHTTPAfterResponseRuleBackendUpdate creates an operation to update an HTTP after-response rule in a backend.
func NewHTTPCheckBackendCreate ¶
NewHTTPCheckBackendCreate creates an operation to create an HTTP check in a backend.
func NewHTTPCheckBackendDelete ¶
NewHTTPCheckBackendDelete creates an operation to delete an HTTP check from a backend.
func NewHTTPCheckBackendUpdate ¶
NewHTTPCheckBackendUpdate creates an operation to update an HTTP check in a backend.
func NewHTTPErrorsSectionCreate ¶
func NewHTTPErrorsSectionCreate(section *models.HTTPErrorsSection) Operation
NewHTTPErrorsSectionCreate creates an operation to create an http-errors section.
func NewHTTPErrorsSectionDelete ¶
func NewHTTPErrorsSectionDelete(section *models.HTTPErrorsSection) Operation
NewHTTPErrorsSectionDelete creates an operation to delete an http-errors section.
func NewHTTPErrorsSectionUpdate ¶
func NewHTTPErrorsSectionUpdate(section *models.HTTPErrorsSection) Operation
NewHTTPErrorsSectionUpdate creates an operation to update an http-errors section.
func NewHTTPRequestRuleBackendCreate ¶
func NewHTTPRequestRuleBackendCreate(backendName string, rule *models.HTTPRequestRule, index int) Operation
NewHTTPRequestRuleBackendCreate creates an operation to create an HTTP request rule in a backend.
func NewHTTPRequestRuleBackendDelete ¶
func NewHTTPRequestRuleBackendDelete(backendName string, rule *models.HTTPRequestRule, index int) Operation
NewHTTPRequestRuleBackendDelete creates an operation to delete an HTTP request rule from a backend.
func NewHTTPRequestRuleBackendUpdate ¶
func NewHTTPRequestRuleBackendUpdate(backendName string, rule *models.HTTPRequestRule, index int) Operation
NewHTTPRequestRuleBackendUpdate creates an operation to update an HTTP request rule in a backend.
func NewHTTPRequestRuleFrontendCreate ¶
func NewHTTPRequestRuleFrontendCreate(frontendName string, rule *models.HTTPRequestRule, index int) Operation
NewHTTPRequestRuleFrontendCreate creates an operation to create an HTTP request rule in a frontend.
func NewHTTPRequestRuleFrontendDelete ¶
func NewHTTPRequestRuleFrontendDelete(frontendName string, rule *models.HTTPRequestRule, index int) Operation
NewHTTPRequestRuleFrontendDelete creates an operation to delete an HTTP request rule from a frontend.
func NewHTTPRequestRuleFrontendUpdate ¶
func NewHTTPRequestRuleFrontendUpdate(frontendName string, rule *models.HTTPRequestRule, index int) Operation
NewHTTPRequestRuleFrontendUpdate creates an operation to update an HTTP request rule in a frontend.
func NewHTTPResponseRuleBackendCreate ¶
func NewHTTPResponseRuleBackendCreate(backendName string, rule *models.HTTPResponseRule, index int) Operation
NewHTTPResponseRuleBackendCreate creates an operation to create an HTTP response rule in a backend.
func NewHTTPResponseRuleBackendDelete ¶
func NewHTTPResponseRuleBackendDelete(backendName string, rule *models.HTTPResponseRule, index int) Operation
NewHTTPResponseRuleBackendDelete creates an operation to delete an HTTP response rule from a backend.
func NewHTTPResponseRuleBackendUpdate ¶
func NewHTTPResponseRuleBackendUpdate(backendName string, rule *models.HTTPResponseRule, index int) Operation
NewHTTPResponseRuleBackendUpdate creates an operation to update an HTTP response rule in a backend.
func NewHTTPResponseRuleFrontendCreate ¶
func NewHTTPResponseRuleFrontendCreate(frontendName string, rule *models.HTTPResponseRule, index int) Operation
NewHTTPResponseRuleFrontendCreate creates an operation to create an HTTP response rule in a frontend.
func NewHTTPResponseRuleFrontendDelete ¶
func NewHTTPResponseRuleFrontendDelete(frontendName string, rule *models.HTTPResponseRule, index int) Operation
NewHTTPResponseRuleFrontendDelete creates an operation to delete an HTTP response rule from a frontend.
func NewHTTPResponseRuleFrontendUpdate ¶
func NewHTTPResponseRuleFrontendUpdate(frontendName string, rule *models.HTTPResponseRule, index int) Operation
NewHTTPResponseRuleFrontendUpdate creates an operation to update an HTTP response rule in a frontend.
func NewLogForwardCreate ¶
func NewLogForwardCreate(logForward *models.LogForward) Operation
NewLogForwardCreate creates an operation to create a log-forward section.
func NewLogForwardDelete ¶
func NewLogForwardDelete(logForward *models.LogForward) Operation
NewLogForwardDelete creates an operation to delete a log-forward section.
func NewLogForwardUpdate ¶
func NewLogForwardUpdate(logForward *models.LogForward) Operation
NewLogForwardUpdate creates an operation to update a log-forward section.
func NewLogProfileCreate ¶
func NewLogProfileCreate(logProfile *models.LogProfile) Operation
NewLogProfileCreate creates an operation to create a log-profile section.
func NewLogProfileDelete ¶
func NewLogProfileDelete(logProfile *models.LogProfile) Operation
NewLogProfileDelete creates an operation to delete a log-profile section.
func NewLogProfileUpdate ¶
func NewLogProfileUpdate(logProfile *models.LogProfile) Operation
NewLogProfileUpdate creates an operation to update a log-profile section.
func NewLogTargetBackendCreate ¶
func NewLogTargetBackendCreate(backendName string, logTarget *models.LogTarget, index int) Operation
NewLogTargetBackendCreate creates an operation to create a log target in a backend.
func NewLogTargetBackendDelete ¶
func NewLogTargetBackendDelete(backendName string, logTarget *models.LogTarget, index int) Operation
NewLogTargetBackendDelete creates an operation to delete a log target from a backend.
func NewLogTargetBackendUpdate ¶
func NewLogTargetBackendUpdate(backendName string, logTarget *models.LogTarget, index int) Operation
NewLogTargetBackendUpdate creates an operation to update a log target in a backend.
func NewLogTargetFrontendCreate ¶
func NewLogTargetFrontendCreate(frontendName string, logTarget *models.LogTarget, index int) Operation
NewLogTargetFrontendCreate creates an operation to create a log target in a frontend.
func NewLogTargetFrontendDelete ¶
func NewLogTargetFrontendDelete(frontendName string, logTarget *models.LogTarget, index int) Operation
NewLogTargetFrontendDelete creates an operation to delete a log target from a frontend.
func NewLogTargetFrontendUpdate ¶
func NewLogTargetFrontendUpdate(frontendName string, logTarget *models.LogTarget, index int) Operation
NewLogTargetFrontendUpdate creates an operation to update a log target in a frontend.
func NewMailerEntryCreate ¶
func NewMailerEntryCreate(mailersName string, entry *models.MailerEntry) Operation
NewMailerEntryCreate creates an operation to create a mailer entry.
func NewMailerEntryDelete ¶
func NewMailerEntryDelete(mailersName string, entry *models.MailerEntry) Operation
NewMailerEntryDelete creates an operation to delete a mailer entry.
func NewMailerEntryUpdate ¶
func NewMailerEntryUpdate(mailersName string, entry *models.MailerEntry) Operation
NewMailerEntryUpdate creates an operation to update a mailer entry.
func NewMailersSectionCreate ¶
func NewMailersSectionCreate(section *models.MailersSection) Operation
NewMailersSectionCreate creates an operation to create a mailers section.
func NewMailersSectionDelete ¶
func NewMailersSectionDelete(section *models.MailersSection) Operation
NewMailersSectionDelete creates an operation to delete a mailers section.
func NewMailersSectionUpdate ¶
func NewMailersSectionUpdate(section *models.MailersSection) Operation
NewMailersSectionUpdate creates an operation to update a mailers section.
func NewNameserverCreate ¶
func NewNameserverCreate(resolverName string, nameserver *models.Nameserver) Operation
NewNameserverCreate creates an operation to create a nameserver in a resolver.
func NewNameserverDelete ¶
func NewNameserverDelete(resolverName string, nameserver *models.Nameserver) Operation
NewNameserverDelete creates an operation to delete a nameserver from a resolver.
func NewNameserverUpdate ¶
func NewNameserverUpdate(resolverName string, nameserver *models.Nameserver) Operation
NewNameserverUpdate creates an operation to update a nameserver in a resolver.
func NewPeerEntryCreate ¶
NewPeerEntryCreate creates an operation to create a peer entry.
func NewPeerEntryDelete ¶
NewPeerEntryDelete creates an operation to delete a peer entry.
func NewPeerEntryUpdate ¶
NewPeerEntryUpdate creates an operation to update a peer entry.
func NewPeerSectionCreate ¶
func NewPeerSectionCreate(section *models.PeerSection) Operation
NewPeerSectionCreate creates an operation to create a peer section.
func NewPeerSectionDelete ¶
func NewPeerSectionDelete(section *models.PeerSection) Operation
NewPeerSectionDelete creates an operation to delete a peer section.
func NewPeerSectionUpdate ¶
func NewPeerSectionUpdate(section *models.PeerSection) Operation
NewPeerSectionUpdate creates an operation to update a peer section. Note: This operation will fail at execution time as the HAProxy Dataplane API does not support updating peer sections directly.
func NewProgramCreate ¶
NewProgramCreate creates an operation to create a program section.
func NewProgramDelete ¶
NewProgramDelete creates an operation to delete a program section.
func NewProgramUpdate ¶
NewProgramUpdate creates an operation to update a program section.
func NewQUICInitialRuleDefaultsCreate ¶
func NewQUICInitialRuleDefaultsCreate(defaultsName string, rule *models.QUICInitialRule, index int) Operation
NewQUICInitialRuleDefaultsCreate creates an operation to create a QUIC initial rule in defaults. QUIC initial rules are only available in HAProxy DataPlane API v3.1+.
func NewQUICInitialRuleDefaultsDelete ¶
func NewQUICInitialRuleDefaultsDelete(defaultsName string, rule *models.QUICInitialRule, index int) Operation
NewQUICInitialRuleDefaultsDelete creates an operation to delete a QUIC initial rule from defaults. QUIC initial rules are only available in HAProxy DataPlane API v3.1+.
func NewQUICInitialRuleDefaultsUpdate ¶
func NewQUICInitialRuleDefaultsUpdate(defaultsName string, rule *models.QUICInitialRule, index int) Operation
NewQUICInitialRuleDefaultsUpdate creates an operation to update a QUIC initial rule in defaults. QUIC initial rules are only available in HAProxy DataPlane API v3.1+.
func NewQUICInitialRuleFrontendCreate ¶
func NewQUICInitialRuleFrontendCreate(frontendName string, rule *models.QUICInitialRule, index int) Operation
NewQUICInitialRuleFrontendCreate creates an operation to create a QUIC initial rule in a frontend. QUIC initial rules are only available in HAProxy DataPlane API v3.1+.
func NewQUICInitialRuleFrontendDelete ¶
func NewQUICInitialRuleFrontendDelete(frontendName string, rule *models.QUICInitialRule, index int) Operation
NewQUICInitialRuleFrontendDelete creates an operation to delete a QUIC initial rule from a frontend. QUIC initial rules are only available in HAProxy DataPlane API v3.1+.
func NewQUICInitialRuleFrontendUpdate ¶
func NewQUICInitialRuleFrontendUpdate(frontendName string, rule *models.QUICInitialRule, index int) Operation
NewQUICInitialRuleFrontendUpdate creates an operation to update a QUIC initial rule in a frontend. QUIC initial rules are only available in HAProxy DataPlane API v3.1+.
func NewResolverCreate ¶
NewResolverCreate creates an operation to create a resolver section.
func NewResolverDelete ¶
NewResolverDelete creates an operation to delete a resolver section.
func NewResolverUpdate ¶
NewResolverUpdate creates an operation to update a resolver section.
func NewRingCreate ¶
NewRingCreate creates an operation to create a ring section.
func NewRingDelete ¶
NewRingDelete creates an operation to delete a ring section.
func NewRingUpdate ¶
NewRingUpdate creates an operation to update a ring section.
func NewServerCreate ¶
NewServerCreate creates an operation to create a server in a backend.
func NewServerDelete ¶
NewServerDelete creates an operation to delete a server from a backend.
func NewServerSwitchingRuleBackendCreate ¶
func NewServerSwitchingRuleBackendCreate(backendName string, rule *models.ServerSwitchingRule, index int) Operation
NewServerSwitchingRuleBackendCreate creates an operation to create a server switching rule in a backend.
func NewServerSwitchingRuleBackendDelete ¶
func NewServerSwitchingRuleBackendDelete(backendName string, rule *models.ServerSwitchingRule, index int) Operation
NewServerSwitchingRuleBackendDelete creates an operation to delete a server switching rule from a backend.
func NewServerSwitchingRuleBackendUpdate ¶
func NewServerSwitchingRuleBackendUpdate(backendName string, rule *models.ServerSwitchingRule, index int) Operation
NewServerSwitchingRuleBackendUpdate creates an operation to update a server switching rule in a backend.
func NewServerTemplateCreate ¶
func NewServerTemplateCreate(backendName string, serverTemplate *models.ServerTemplate) Operation
NewServerTemplateCreate creates an operation to create a server template in a backend.
func NewServerTemplateDelete ¶
func NewServerTemplateDelete(backendName string, serverTemplate *models.ServerTemplate) Operation
NewServerTemplateDelete creates an operation to delete a server template from a backend.
func NewServerTemplateUpdate ¶
func NewServerTemplateUpdate(backendName string, serverTemplate *models.ServerTemplate) Operation
NewServerTemplateUpdate creates an operation to update a server template in a backend.
func NewServerUpdate ¶
NewServerUpdate creates an operation to update a server in a backend. Unlike other operations, server updates use a specialized type that tracks reload status for runtime-eligible operations.
func NewStickRuleBackendCreate ¶
NewStickRuleBackendCreate creates an operation to create a stick rule in a backend.
func NewStickRuleBackendDelete ¶
NewStickRuleBackendDelete creates an operation to delete a stick rule from a backend.
func NewStickRuleBackendUpdate ¶
NewStickRuleBackendUpdate creates an operation to update a stick rule in a backend.
func NewTCPCheckBackendCreate ¶
NewTCPCheckBackendCreate creates an operation to create a TCP check in a backend.
func NewTCPCheckBackendDelete ¶
NewTCPCheckBackendDelete creates an operation to delete a TCP check from a backend.
func NewTCPCheckBackendUpdate ¶
NewTCPCheckBackendUpdate creates an operation to update a TCP check in a backend.
func NewTCPRequestRuleBackendCreate ¶
func NewTCPRequestRuleBackendCreate(backendName string, rule *models.TCPRequestRule, index int) Operation
NewTCPRequestRuleBackendCreate creates an operation to create a TCP request rule in a backend.
func NewTCPRequestRuleBackendDelete ¶
func NewTCPRequestRuleBackendDelete(backendName string, rule *models.TCPRequestRule, index int) Operation
NewTCPRequestRuleBackendDelete creates an operation to delete a TCP request rule from a backend.
func NewTCPRequestRuleBackendUpdate ¶
func NewTCPRequestRuleBackendUpdate(backendName string, rule *models.TCPRequestRule, index int) Operation
NewTCPRequestRuleBackendUpdate creates an operation to update a TCP request rule in a backend.
func NewTCPRequestRuleFrontendCreate ¶
func NewTCPRequestRuleFrontendCreate(frontendName string, rule *models.TCPRequestRule, index int) Operation
NewTCPRequestRuleFrontendCreate creates an operation to create a TCP request rule in a frontend.
func NewTCPRequestRuleFrontendDelete ¶
func NewTCPRequestRuleFrontendDelete(frontendName string, rule *models.TCPRequestRule, index int) Operation
NewTCPRequestRuleFrontendDelete creates an operation to delete a TCP request rule from a frontend.
func NewTCPRequestRuleFrontendUpdate ¶
func NewTCPRequestRuleFrontendUpdate(frontendName string, rule *models.TCPRequestRule, index int) Operation
NewTCPRequestRuleFrontendUpdate creates an operation to update a TCP request rule in a frontend.
func NewTCPResponseRuleBackendCreate ¶
func NewTCPResponseRuleBackendCreate(backendName string, rule *models.TCPResponseRule, index int) Operation
NewTCPResponseRuleBackendCreate creates an operation to create a TCP response rule in a backend.
func NewTCPResponseRuleBackendDelete ¶
func NewTCPResponseRuleBackendDelete(backendName string, rule *models.TCPResponseRule, index int) Operation
NewTCPResponseRuleBackendDelete creates an operation to delete a TCP response rule from a backend.
func NewTCPResponseRuleBackendUpdate ¶
func NewTCPResponseRuleBackendUpdate(backendName string, rule *models.TCPResponseRule, index int) Operation
NewTCPResponseRuleBackendUpdate creates an operation to update a TCP response rule in a backend.
func NewTracesUpdate ¶
NewTracesUpdate creates an operation to update the traces section. The traces section is a singleton - it can be created or replaced. Traces configuration is only available in HAProxy DataPlane API v3.1+.
func NewUserCreate ¶
NewUserCreate creates an operation to create a user in a userlist.
func NewUserDelete ¶
NewUserDelete creates an operation to delete a user from a userlist.
func NewUserUpdate ¶
NewUserUpdate creates an operation to update a user in a userlist.
func NewUserlistCreate ¶
NewUserlistCreate creates an operation to create a userlist section.
func NewUserlistDelete ¶
NewUserlistDelete creates an operation to delete a userlist section.
func NewWAFGlobalCreate ¶
NewWAFGlobalCreate creates an operation to create the WAF global configuration. WAF global is a singleton section (only one per configuration).
func NewWAFGlobalDelete ¶
NewWAFGlobalDelete creates an operation to delete the WAF global configuration.
func NewWAFGlobalUpdate ¶
NewWAFGlobalUpdate creates an operation to update the WAF global configuration.
func NewWAFProfileCreate ¶
func NewWAFProfileCreate(profile *v32ee.WafProfile) Operation
NewWAFProfileCreate creates an operation to create a WAF profile. WAF profiles are only available in HAProxy Enterprise Edition v3.2+.
func NewWAFProfileDelete ¶
func NewWAFProfileDelete(profile *v32ee.WafProfile) Operation
NewWAFProfileDelete creates an operation to delete a WAF profile.
func NewWAFProfileUpdate ¶
func NewWAFProfileUpdate(profile *v32ee.WafProfile) Operation
NewWAFProfileUpdate creates an operation to update a WAF profile.
type OperationType ¶
type OperationType int
OperationType represents the type of HAProxy configuration operation.
const ( OperationCreate OperationType = iota OperationUpdate OperationDelete )
type RuntimeReloadTracker ¶
type RuntimeReloadTracker interface {
// TriggeredReload returns true if the operation triggered a HAProxy reload
// during its last execution. This is only meaningful for runtime-eligible
// operations (server updates with empty transaction ID).
TriggeredReload() bool
}
RuntimeReloadTracker is an optional interface for operations that can track whether they triggered a HAProxy reload during runtime execution. Only server update operations implement this interface since they can be executed via the runtime API without a transaction.
type ServerUpdateOp ¶
type ServerUpdateOp struct {
// contains filtered or unexported fields
}
ServerUpdateOp is a specialized operation for server updates that tracks whether the update triggered a HAProxy reload. This is needed because server updates can be executed via the runtime API (without transaction) and the DataPlane API returns 202 if a reload was required.
func (*ServerUpdateOp) BackendName ¶
func (op *ServerUpdateOp) BackendName() string
BackendName returns the name of the backend containing this server. Used by the orchestrator for direct executor calls with version caching.
func (*ServerUpdateOp) Describe ¶
func (op *ServerUpdateOp) Describe() string
func (*ServerUpdateOp) Execute ¶
func (op *ServerUpdateOp) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
Execute performs the server update operation. When txID is empty (runtime execution), it tracks whether the operation triggered a reload.
func (*ServerUpdateOp) Priority ¶
func (op *ServerUpdateOp) Priority() int
func (*ServerUpdateOp) Section ¶
func (op *ServerUpdateOp) Section() string
func (*ServerUpdateOp) Server ¶
func (op *ServerUpdateOp) Server() *models.Server
Server returns the server model being updated. Used by the orchestrator for direct executor calls with version caching.
func (*ServerUpdateOp) ServerName ¶
func (op *ServerUpdateOp) ServerName() string
ServerName returns the name of the server being updated. Used by the orchestrator for direct executor calls with version caching.
func (*ServerUpdateOp) TriggeredReload ¶
func (op *ServerUpdateOp) TriggeredReload() bool
TriggeredReload implements RuntimeReloadTracker interface. Returns true if the last Execute call triggered a HAProxy reload.
func (*ServerUpdateOp) Type ¶
func (op *ServerUpdateOp) Type() OperationType
type SingletonOp ¶
SingletonOp handles operations for singleton sections like global, traces, or waf-global. Supports create, update, and delete operations for singleton resources.
func NewSingletonOp ¶
func NewSingletonOp[TModel any, TAPI any]( opType OperationType, sectionName string, priority int, model TModel, transformFn func(TModel) TAPI, executeFn ExecuteSingletonFunc[TAPI], describeFn func() string, ) *SingletonOp[TModel, TAPI]
NewSingletonOp creates a new singleton operation with the specified operation type.
func (*SingletonOp[TModel, TAPI]) Describe ¶
func (op *SingletonOp[TModel, TAPI]) Describe() string
func (*SingletonOp[TModel, TAPI]) Execute ¶
func (op *SingletonOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
func (*SingletonOp[TModel, TAPI]) Priority ¶
func (op *SingletonOp[TModel, TAPI]) Priority() int
Priority returns the effective priority. Uses multiplier for compatibility with IndexChildOp.
func (*SingletonOp[TModel, TAPI]) Section ¶
func (op *SingletonOp[TModel, TAPI]) Section() string
func (*SingletonOp[TModel, TAPI]) Type ¶
func (op *SingletonOp[TModel, TAPI]) Type() OperationType
type TopLevelCRUD ¶
type TopLevelCRUD[T any] struct { Create func(model T) Operation Update func(model T) Operation Delete func(model T) Operation }
TopLevelCRUD holds pre-built Create/Update/Delete factory functions for a top-level resource.
func NewTopLevelCRUD ¶
func NewTopLevelCRUD[T any]( section, displayName string, priority int, nameFn func(T) string, createExec, updateExec, deleteExec ExecuteTopLevelFunc[T], ) TopLevelCRUD[T]
NewTopLevelCRUD creates a CRUD builder for a top-level resource (backend, frontend, etc.). The displayName is used in operation descriptions and may differ from the section name.
type TopLevelOp ¶
TopLevelOp handles operations for top-level named resources like backend, frontend, defaults. These resources are identified by a single name and use DispatchCreate/Update/Delete.
func NewTopLevelOp ¶
func NewTopLevelOp[TModel any, TAPI any]( opType OperationType, sectionName string, priority int, model TModel, transformFn func(TModel) TAPI, nameFn func(TModel) string, executeFn ExecuteTopLevelFunc[TAPI], describeFn func() string, ) *TopLevelOp[TModel, TAPI]
NewTopLevelOp creates a new top-level operation.
func (*TopLevelOp[TModel, TAPI]) Describe ¶
func (op *TopLevelOp[TModel, TAPI]) Describe() string
func (*TopLevelOp[TModel, TAPI]) Execute ¶
func (op *TopLevelOp[TModel, TAPI]) Execute(ctx context.Context, c *client.DataplaneClient, txID string) error
func (*TopLevelOp[TModel, TAPI]) Priority ¶
func (op *TopLevelOp[TModel, TAPI]) Priority() int
Priority returns the effective priority. Uses multiplier for compatibility with IndexChildOp.
func (*TopLevelOp[TModel, TAPI]) Section ¶
func (op *TopLevelOp[TModel, TAPI]) Section() string
func (*TopLevelOp[TModel, TAPI]) Type ¶
func (op *TopLevelOp[TModel, TAPI]) Type() OperationType