sections

package
v0.1.0-alpha.7 Latest Latest
Warning

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

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

Documentation

Overview

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) - UDP LB (v3.0+ EE) - TODO when API support is added

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

View Source
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

	// PriorityEEUDPLB is the priority for UDP load balancer operations.
	// Similar priority to backends/frontends.
	PriorityEEUDPLB = 30
)

Priority constants for Enterprise Edition sections.

View Source
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. Lower priority = executed first for Creates, executed last for Deletes. Higher priority = executed last for Creates, executed first for Deletes.

Variables

This section is empty.

Functions

func ACLName

func ACLName(a *models.ACL) string

ACLName extracts the name from an ACL model.

func AcmeProviderName

func AcmeProviderName(a *models.AcmeProvider) string

AcmeProviderName extracts the name from an AcmeProvider model.

func BackendName

func BackendName(b *models.Backend) string

BackendName extracts the name from a Backend model.

func BindName

func BindName(b *models.Bind) string

BindName extracts the name from a Bind model.

func BotMgmtProfileName

func BotMgmtProfileName(p *v32ee.BotmgmtProfile) string

BotMgmtProfileName extracts the name from a BotmgmtProfile model.

func CacheName

func CacheName(c *models.Cache) string

CacheName extracts the name from a Cache model.

func CaptchaEEName

func CaptchaEEName(c *v32ee.Captcha) string

CaptchaEEName extracts the name from a Captcha model. Named CaptchaEEName to avoid conflict with CaptchaName in helpers.go.

func CrtStoreName

func CrtStoreName(c *models.CrtStore) string

CrtStoreName extracts the name from a CrtStore model.

func DefaultsName

func DefaultsName(d *models.Defaults) string

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

func FCGIAppName(f *models.FCGIApp) string

FCGIAppName extracts the name from an FCGIApp model.

func FilterType

func FilterType(f *models.Filter) string

FilterType extracts the type from a Filter model (for description purposes).

func FrontendName

func FrontendName(f *models.Frontend) string

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 IdentityACL

func IdentityACL(a *models.ACL) *models.ACL

IdentityACL returns the model as-is.

func IdentityAcmeProvider

func IdentityAcmeProvider(a *models.AcmeProvider) *models.AcmeProvider

IdentityAcmeProvider returns the model as-is.

func IdentityBackend

func IdentityBackend(b *models.Backend) *models.Backend

IdentityBackend returns the model as-is.

func IdentityBackendSwitchingRule

func IdentityBackendSwitchingRule(r *models.BackendSwitchingRule) *models.BackendSwitchingRule

IdentityBackendSwitchingRule returns the model as-is.

func IdentityBind

func IdentityBind(b *models.Bind) *models.Bind

IdentityBind returns the model as-is.

func IdentityBotMgmtProfile

func IdentityBotMgmtProfile(p *v32ee.BotmgmtProfile) *v32ee.BotmgmtProfile

IdentityBotMgmtProfile returns the model as-is.

func IdentityCache

func IdentityCache(c *models.Cache) *models.Cache

IdentityCache returns the model as-is.

func IdentityCaptchaEE

func IdentityCaptchaEE(c *v32ee.Captcha) *v32ee.Captcha

IdentityCaptchaEE returns the model as-is. Named IdentityCaptchaEE to avoid conflict with IdentityCapture in helpers.go.

func IdentityCapture

func IdentityCapture(c *models.Capture) *models.Capture

IdentityCapture returns the model as-is.

func IdentityCrtStore

func IdentityCrtStore(c *models.CrtStore) *models.CrtStore

IdentityCrtStore returns the model as-is.

func IdentityDefaults

func IdentityDefaults(d *models.Defaults) *models.Defaults

IdentityDefaults returns the model as-is.

func IdentityFCGIApp

func IdentityFCGIApp(f *models.FCGIApp) *models.FCGIApp

IdentityFCGIApp returns the model as-is.

func IdentityFilter

func IdentityFilter(f *models.Filter) *models.Filter

IdentityFilter returns the model as-is.

func IdentityFrontend

func IdentityFrontend(f *models.Frontend) *models.Frontend

IdentityFrontend returns the model as-is.

func IdentityGlobal

func IdentityGlobal(g *models.Global) *models.Global

IdentityGlobal returns the model as-is.

func IdentityHTTPAfterResponseRule

func IdentityHTTPAfterResponseRule(r *models.HTTPAfterResponseRule) *models.HTTPAfterResponseRule

IdentityHTTPAfterResponseRule returns the model as-is.

func IdentityHTTPCheck

func IdentityHTTPCheck(c *models.HTTPCheck) *models.HTTPCheck

IdentityHTTPCheck returns the model as-is.

func IdentityHTTPErrorsSection

func IdentityHTTPErrorsSection(h *models.HTTPErrorsSection) *models.HTTPErrorsSection

IdentityHTTPErrorsSection returns the model as-is.

func IdentityHTTPRequestRule

func IdentityHTTPRequestRule(r *models.HTTPRequestRule) *models.HTTPRequestRule

IdentityHTTPRequestRule returns the model as-is.

func IdentityHTTPResponseRule

func IdentityHTTPResponseRule(r *models.HTTPResponseRule) *models.HTTPResponseRule

IdentityHTTPResponseRule returns the model as-is.

func IdentityLogForward

func IdentityLogForward(l *models.LogForward) *models.LogForward

IdentityLogForward returns the model as-is.

func IdentityLogProfile

func IdentityLogProfile(l *models.LogProfile) *models.LogProfile

IdentityLogProfile returns the model as-is.

func IdentityLogTarget

func IdentityLogTarget(l *models.LogTarget) *models.LogTarget

IdentityLogTarget returns the model as-is.

func IdentityMailerEntry

func IdentityMailerEntry(m *models.MailerEntry) *models.MailerEntry

IdentityMailerEntry returns the model as-is.

func IdentityMailersSection

func IdentityMailersSection(m *models.MailersSection) *models.MailersSection

IdentityMailersSection returns the model as-is.

func IdentityNameserver

func IdentityNameserver(n *models.Nameserver) *models.Nameserver

IdentityNameserver returns the model as-is.

func IdentityPeerEntry

func IdentityPeerEntry(p *models.PeerEntry) *models.PeerEntry

IdentityPeerEntry returns the model as-is.

func IdentityPeerSection

func IdentityPeerSection(p *models.PeerSection) *models.PeerSection

IdentityPeerSection returns the model as-is.

func IdentityProgram

func IdentityProgram(p *models.Program) *models.Program

IdentityProgram returns the model as-is.

func IdentityQUICInitialRule

func IdentityQUICInitialRule(r *models.QUICInitialRule) *models.QUICInitialRule

IdentityQUICInitialRule returns the model as-is.

func IdentityResolver

func IdentityResolver(r *models.Resolver) *models.Resolver

IdentityResolver returns the model as-is.

func IdentityRing

func IdentityRing(r *models.Ring) *models.Ring

IdentityRing returns the model as-is.

func IdentityServer

func IdentityServer(s *models.Server) *models.Server

IdentityServer returns the model as-is.

func IdentityServerSwitchingRule

func IdentityServerSwitchingRule(r *models.ServerSwitchingRule) *models.ServerSwitchingRule

IdentityServerSwitchingRule returns the model as-is.

func IdentityServerTemplate

func IdentityServerTemplate(s *models.ServerTemplate) *models.ServerTemplate

IdentityServerTemplate returns the model as-is.

func IdentityStickRule

func IdentityStickRule(r *models.StickRule) *models.StickRule

IdentityStickRule returns the model as-is.

func IdentityTCPCheck

func IdentityTCPCheck(c *models.TCPCheck) *models.TCPCheck

IdentityTCPCheck returns the model as-is.

func IdentityTCPRequestRule

func IdentityTCPRequestRule(r *models.TCPRequestRule) *models.TCPRequestRule

IdentityTCPRequestRule returns the model as-is.

func IdentityTCPResponseRule

func IdentityTCPResponseRule(r *models.TCPResponseRule) *models.TCPResponseRule

IdentityTCPResponseRule returns the model as-is.

func IdentityTraces

func IdentityTraces(t *models.Traces) *models.Traces

IdentityTraces returns the model as-is.

func IdentityUser

func IdentityUser(u *models.User) *models.User

IdentityUser returns the model as-is.

func IdentityUserlist

func IdentityUserlist(u *models.Userlist) *models.Userlist

IdentityUserlist returns the model as-is.

func IdentityWAFGlobal

func IdentityWAFGlobal(w *v32ee.WafGlobal) *v32ee.WafGlobal

IdentityWAFGlobal returns the model as-is.

func IdentityWAFProfile

func IdentityWAFProfile(p *v32ee.WafProfile) *v32ee.WafProfile

IdentityWAFProfile returns the model as-is.

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 NilACL

func NilACL(_ *models.ACL) *models.ACL

NilACL returns nil, used for delete operations where model isn't needed.

func NilAcmeProvider

func NilAcmeProvider(_ *models.AcmeProvider) *models.AcmeProvider

NilAcmeProvider returns nil, used for delete operations where model isn't needed.

func NilBackend

func NilBackend(_ *models.Backend) *models.Backend

NilBackend returns nil, used for delete operations where model isn't needed.

func NilBackendSwitchingRule

func NilBackendSwitchingRule(_ *models.BackendSwitchingRule) *models.BackendSwitchingRule

NilBackendSwitchingRule returns nil, used for delete operations where model isn't needed.

func NilBind

func NilBind(_ *models.Bind) *models.Bind

NilBind returns nil, used for delete operations where model isn't needed.

func NilBotMgmtProfile

func NilBotMgmtProfile(_ *v32ee.BotmgmtProfile) *v32ee.BotmgmtProfile

NilBotMgmtProfile returns nil, used for delete operations where model isn't needed.

func NilCache

func NilCache(_ *models.Cache) *models.Cache

NilCache returns nil, used for delete operations where model isn't needed.

func NilCaptchaEE

func NilCaptchaEE(_ *v32ee.Captcha) *v32ee.Captcha

NilCaptchaEE returns nil, used for delete operations where model isn't needed. Named NilCaptchaEE to avoid conflict with NilCapture in helpers.go.

func NilCapture

func NilCapture(_ *models.Capture) *models.Capture

NilCapture returns nil, used for delete operations where model isn't needed.

func NilCrtStore

func NilCrtStore(_ *models.CrtStore) *models.CrtStore

NilCrtStore returns nil, used for delete operations where model isn't needed.

func NilDefaults

func NilDefaults(_ *models.Defaults) *models.Defaults

NilDefaults returns nil, used for delete operations where model isn't needed.

func NilFCGIApp

func NilFCGIApp(_ *models.FCGIApp) *models.FCGIApp

NilFCGIApp returns nil, used for delete operations where model isn't needed.

func NilFilter

func NilFilter(_ *models.Filter) *models.Filter

NilFilter returns nil, used for delete operations where model isn't needed.

func NilFrontend

func NilFrontend(_ *models.Frontend) *models.Frontend

NilFrontend returns nil, used for delete operations where model isn't needed.

func NilHTTPAfterResponseRule

func NilHTTPAfterResponseRule(_ *models.HTTPAfterResponseRule) *models.HTTPAfterResponseRule

NilHTTPAfterResponseRule returns nil, used for delete operations where model isn't needed.

func NilHTTPCheck

func NilHTTPCheck(_ *models.HTTPCheck) *models.HTTPCheck

NilHTTPCheck returns nil, used for delete operations where model isn't needed.

func NilHTTPErrorsSection

func NilHTTPErrorsSection(_ *models.HTTPErrorsSection) *models.HTTPErrorsSection

NilHTTPErrorsSection returns nil, used for delete operations where model isn't needed.

func NilHTTPRequestRule

func NilHTTPRequestRule(_ *models.HTTPRequestRule) *models.HTTPRequestRule

NilHTTPRequestRule returns nil, used for delete operations where model isn't needed.

func NilHTTPResponseRule

func NilHTTPResponseRule(_ *models.HTTPResponseRule) *models.HTTPResponseRule

NilHTTPResponseRule returns nil, used for delete operations where model isn't needed.

func NilLogForward

func NilLogForward(_ *models.LogForward) *models.LogForward

NilLogForward returns nil, used for delete operations where model isn't needed.

func NilLogProfile

func NilLogProfile(_ *models.LogProfile) *models.LogProfile

NilLogProfile returns nil, used for delete operations where model isn't needed.

func NilLogTarget

func NilLogTarget(_ *models.LogTarget) *models.LogTarget

NilLogTarget returns nil, used for delete operations where model isn't needed.

func NilMailerEntry

func NilMailerEntry(_ *models.MailerEntry) *models.MailerEntry

NilMailerEntry returns nil, used for delete operations where model isn't needed.

func NilMailersSection

func NilMailersSection(_ *models.MailersSection) *models.MailersSection

NilMailersSection returns nil, used for delete operations where model isn't needed.

func NilNameserver

func NilNameserver(_ *models.Nameserver) *models.Nameserver

NilNameserver returns nil, used for delete operations where model isn't needed.

func NilPeerEntry

func NilPeerEntry(_ *models.PeerEntry) *models.PeerEntry

NilPeerEntry returns nil, used for delete operations where model isn't needed.

func NilPeerSection

func NilPeerSection(_ *models.PeerSection) *models.PeerSection

NilPeerSection returns nil, used for delete operations where model isn't needed.

func NilProgram

func NilProgram(_ *models.Program) *models.Program

NilProgram returns nil, used for delete operations where model isn't needed.

func NilQUICInitialRule

func NilQUICInitialRule(_ *models.QUICInitialRule) *models.QUICInitialRule

NilQUICInitialRule returns nil, used for delete operations where model isn't needed.

func NilResolver

func NilResolver(_ *models.Resolver) *models.Resolver

NilResolver returns nil, used for delete operations where model isn't needed.

func NilRing

func NilRing(_ *models.Ring) *models.Ring

NilRing returns nil, used for delete operations where model isn't needed.

func NilServer

func NilServer(_ *models.Server) *models.Server

NilServer returns nil, used for delete operations where model isn't needed.

func NilServerSwitchingRule

func NilServerSwitchingRule(_ *models.ServerSwitchingRule) *models.ServerSwitchingRule

NilServerSwitchingRule returns nil, used for delete operations where model isn't needed.

func NilServerTemplate

func NilServerTemplate(_ *models.ServerTemplate) *models.ServerTemplate

NilServerTemplate returns nil, used for delete operations where model isn't needed.

func NilStickRule

func NilStickRule(_ *models.StickRule) *models.StickRule

NilStickRule returns nil, used for delete operations where model isn't needed.

func NilTCPCheck

func NilTCPCheck(_ *models.TCPCheck) *models.TCPCheck

NilTCPCheck returns nil, used for delete operations where model isn't needed.

func NilTCPRequestRule

func NilTCPRequestRule(_ *models.TCPRequestRule) *models.TCPRequestRule

NilTCPRequestRule returns nil, used for delete operations where model isn't needed.

func NilTCPResponseRule

func NilTCPResponseRule(_ *models.TCPResponseRule) *models.TCPResponseRule

NilTCPResponseRule returns nil, used for delete operations where model isn't needed.

func NilUser

func NilUser(_ *models.User) *models.User

NilUser returns nil, used for delete operations where model isn't needed.

func NilUserlist

func NilUserlist(_ *models.Userlist) *models.Userlist

NilUserlist returns nil, used for delete operations where model isn't needed.

func NilWAFGlobal

func NilWAFGlobal(_ *v32ee.WafGlobal) *v32ee.WafGlobal

NilWAFGlobal returns nil, used for delete operations where model isn't needed.

func NilWAFProfile

func NilWAFProfile(_ *v32ee.WafProfile) *v32ee.WafProfile

NilWAFProfile returns nil, used for delete operations where model isn't needed.

func PeerEntryName

func PeerEntryName(p *models.PeerEntry) string

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

func ProgramName(p *models.Program) string

ProgramName extracts the name from a Program model.

func ResolverName

func ResolverName(r *models.Resolver) string

ResolverName extracts the name from a Resolver model.

func RingName

func RingName(r *models.Ring) string

RingName extracts the name from a Ring model.

func ServerName

func ServerName(s *models.Server) string

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 UserName

func UserName(u *models.User) string

UserName extracts the name from a User model.

func UserlistName

func UserlistName(u *models.Userlist) string

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

type ContainerChildOp[TModel any, TAPI any] struct {
	// contains filtered or unexported fields
}

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

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 IndexChildOp

type IndexChildOp[TModel any, TAPI any] struct {
	// contains filtered or unexported fields
}

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

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 NameChildOp

type NameChildOp[TModel any, TAPI any] struct {
	// contains filtered or unexported fields
}

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

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

func NewACLBackendCreate(backendName string, acl *models.ACL, index int) Operation

NewACLBackendCreate creates an operation to create an ACL in a backend.

func NewACLBackendDelete

func NewACLBackendDelete(backendName string, acl *models.ACL, index int) Operation

NewACLBackendDelete creates an operation to delete an ACL from a backend.

func NewACLBackendUpdate

func NewACLBackendUpdate(backendName string, acl *models.ACL, index int) Operation

NewACLBackendUpdate creates an operation to update an ACL in a backend.

func NewACLFrontendCreate

func NewACLFrontendCreate(frontendName string, acl *models.ACL, index int) Operation

NewACLFrontendCreate creates an operation to create an ACL in a frontend.

func NewACLFrontendDelete

func NewACLFrontendDelete(frontendName string, acl *models.ACL, index int) Operation

NewACLFrontendDelete creates an operation to delete an ACL from a frontend.

func NewACLFrontendUpdate

func NewACLFrontendUpdate(frontendName string, acl *models.ACL, index int) Operation

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. ACME providers are only available in HAProxy DataPlane API v3.2+.

func NewAcmeProviderDelete

func NewAcmeProviderDelete(acmeProvider *models.AcmeProvider) Operation

NewAcmeProviderDelete creates an operation to delete an acme section. ACME providers are only available in HAProxy DataPlane API v3.2+.

func NewAcmeProviderUpdate

func NewAcmeProviderUpdate(acmeProvider *models.AcmeProvider) Operation

NewAcmeProviderUpdate creates an operation to update an acme section. ACME providers are only available in HAProxy DataPlane API v3.2+.

func NewBackendCreate

func NewBackendCreate(backend *models.Backend) Operation

NewBackendCreate creates an operation to create a backend.

func NewBackendDelete

func NewBackendDelete(backend *models.Backend) Operation

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

func NewBackendUpdate(backend *models.Backend) Operation

NewBackendUpdate creates an operation to update a backend.

func NewBindFrontendCreate

func NewBindFrontendCreate(frontendName, bindName string, bind *models.Bind) Operation

NewBindFrontendCreate creates an operation to create a bind in a frontend.

func NewBindFrontendDelete

func NewBindFrontendDelete(frontendName, bindName string, bind *models.Bind) Operation

NewBindFrontendDelete creates an operation to delete a bind from a frontend.

func NewBindFrontendUpdate

func NewBindFrontendUpdate(frontendName, bindName string, bind *models.Bind) Operation

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

func NewCacheCreate(cache *models.Cache) Operation

NewCacheCreate creates an operation to create a cache section.

func NewCacheDelete

func NewCacheDelete(cache *models.Cache) Operation

NewCacheDelete creates an operation to delete a cache section.

func NewCacheUpdate

func NewCacheUpdate(cache *models.Cache) Operation

NewCacheUpdate creates an operation to update a cache section.

func NewCaptchaCreate

func NewCaptchaCreate(captcha *v32ee.Captcha) Operation

NewCaptchaCreate creates an operation to create a captcha section. Captcha is only available in HAProxy Enterprise Edition.

func NewCaptchaDelete

func NewCaptchaDelete(captcha *v32ee.Captcha) Operation

NewCaptchaDelete creates an operation to delete a captcha section.

func NewCaptchaUpdate

func NewCaptchaUpdate(captcha *v32ee.Captcha) Operation

NewCaptchaUpdate creates an operation to update a captcha section.

func NewCaptureFrontendCreate

func NewCaptureFrontendCreate(frontendName string, capture *models.Capture, index int) Operation

NewCaptureFrontendCreate creates an operation to create a capture declaration in a frontend.

func NewCaptureFrontendDelete

func NewCaptureFrontendDelete(frontendName string, capture *models.Capture, index int) Operation

NewCaptureFrontendDelete creates an operation to delete a capture declaration from a frontend.

func NewCaptureFrontendUpdate

func NewCaptureFrontendUpdate(frontendName string, capture *models.Capture, index int) Operation

NewCaptureFrontendUpdate creates an operation to update a capture declaration in a frontend.

func NewCrtStoreCreate

func NewCrtStoreCreate(crtStore *models.CrtStore) Operation

NewCrtStoreCreate creates an operation to create a crt-store section.

func NewCrtStoreDelete

func NewCrtStoreDelete(crtStore *models.CrtStore) Operation

NewCrtStoreDelete creates an operation to delete a crt-store section.

func NewCrtStoreUpdate

func NewCrtStoreUpdate(crtStore *models.CrtStore) Operation

NewCrtStoreUpdate creates an operation to update a crt-store section.

func NewDefaultsCreate

func NewDefaultsCreate(defaults *models.Defaults) Operation

NewDefaultsCreate creates an operation to create a defaults section.

func NewDefaultsDelete

func NewDefaultsDelete(defaults *models.Defaults) Operation

NewDefaultsDelete creates an operation to delete a defaults section.

func NewDefaultsUpdate

func NewDefaultsUpdate(defaults *models.Defaults) Operation

NewDefaultsUpdate creates an operation to update a defaults section.

func NewFCGIAppCreate

func NewFCGIAppCreate(fcgiApp *models.FCGIApp) Operation

NewFCGIAppCreate creates an operation to create a fcgi-app section.

func NewFCGIAppDelete

func NewFCGIAppDelete(fcgiApp *models.FCGIApp) Operation

NewFCGIAppDelete creates an operation to delete a fcgi-app section.

func NewFCGIAppUpdate

func NewFCGIAppUpdate(fcgiApp *models.FCGIApp) Operation

NewFCGIAppUpdate creates an operation to update a fcgi-app section.

func NewFilterBackendCreate

func NewFilterBackendCreate(backendName string, filter *models.Filter, index int) Operation

NewFilterBackendCreate creates an operation to create a filter in a backend.

func NewFilterBackendDelete

func NewFilterBackendDelete(backendName string, filter *models.Filter, index int) Operation

NewFilterBackendDelete creates an operation to delete a filter from a backend.

func NewFilterBackendUpdate

func NewFilterBackendUpdate(backendName string, filter *models.Filter, index int) Operation

NewFilterBackendUpdate creates an operation to update a filter in a backend.

func NewFilterFrontendCreate

func NewFilterFrontendCreate(frontendName string, filter *models.Filter, index int) Operation

NewFilterFrontendCreate creates an operation to create a filter in a frontend.

func NewFilterFrontendDelete

func NewFilterFrontendDelete(frontendName string, filter *models.Filter, index int) Operation

NewFilterFrontendDelete creates an operation to delete a filter from a frontend.

func NewFilterFrontendUpdate

func NewFilterFrontendUpdate(frontendName string, filter *models.Filter, index int) Operation

NewFilterFrontendUpdate creates an operation to update a filter in a frontend.

func NewFrontendCreate

func NewFrontendCreate(frontend *models.Frontend) Operation

NewFrontendCreate creates an operation to create a frontend.

func NewFrontendDelete

func NewFrontendDelete(frontend *models.Frontend) Operation

NewFrontendDelete creates an operation to delete a frontend.

func NewFrontendUpdate

func NewFrontendUpdate(frontend *models.Frontend) Operation

NewFrontendUpdate creates an operation to update a frontend.

func NewGlobalUpdate

func NewGlobalUpdate(global *models.Global) Operation

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

func NewHTTPCheckBackendCreate(backendName string, check *models.HTTPCheck, index int) Operation

NewHTTPCheckBackendCreate creates an operation to create an HTTP check in a backend.

func NewHTTPCheckBackendDelete

func NewHTTPCheckBackendDelete(backendName string, check *models.HTTPCheck, index int) Operation

NewHTTPCheckBackendDelete creates an operation to delete an HTTP check from a backend.

func NewHTTPCheckBackendUpdate

func NewHTTPCheckBackendUpdate(backendName string, check *models.HTTPCheck, index int) Operation

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. Log profiles are only available in HAProxy DataPlane API v3.1+.

func NewLogProfileDelete

func NewLogProfileDelete(logProfile *models.LogProfile) Operation

NewLogProfileDelete creates an operation to delete a log-profile section. Log profiles are only available in HAProxy DataPlane API v3.1+.

func NewLogProfileUpdate

func NewLogProfileUpdate(logProfile *models.LogProfile) Operation

NewLogProfileUpdate creates an operation to update a log-profile section. Log profiles are only available in HAProxy DataPlane API v3.1+.

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

func NewPeerEntryCreate(peerSectionName string, entry *models.PeerEntry) Operation

NewPeerEntryCreate creates an operation to create a peer entry.

func NewPeerEntryDelete

func NewPeerEntryDelete(peerSectionName string, entry *models.PeerEntry) Operation

NewPeerEntryDelete creates an operation to delete a peer entry.

func NewPeerEntryUpdate

func NewPeerEntryUpdate(peerSectionName string, entry *models.PeerEntry) Operation

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

func NewProgramCreate(program *models.Program) Operation

NewProgramCreate creates an operation to create a program section.

func NewProgramDelete

func NewProgramDelete(program *models.Program) Operation

NewProgramDelete creates an operation to delete a program section.

func NewProgramUpdate

func NewProgramUpdate(program *models.Program) Operation

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

func NewResolverCreate(resolver *models.Resolver) Operation

NewResolverCreate creates an operation to create a resolver section.

func NewResolverDelete

func NewResolverDelete(resolver *models.Resolver) Operation

NewResolverDelete creates an operation to delete a resolver section.

func NewResolverUpdate

func NewResolverUpdate(resolver *models.Resolver) Operation

NewResolverUpdate creates an operation to update a resolver section.

func NewRingCreate

func NewRingCreate(ring *models.Ring) Operation

NewRingCreate creates an operation to create a ring section.

func NewRingDelete

func NewRingDelete(ring *models.Ring) Operation

NewRingDelete creates an operation to delete a ring section.

func NewRingUpdate

func NewRingUpdate(ring *models.Ring) Operation

NewRingUpdate creates an operation to update a ring section.

func NewServerCreate

func NewServerCreate(backendName string, server *models.Server) Operation

NewServerCreate creates an operation to create a server in a backend.

func NewServerDelete

func NewServerDelete(backendName string, server *models.Server) Operation

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

func NewServerUpdate(backendName string, server *models.Server) Operation

NewServerUpdate creates an operation to update a server in a backend.

func NewStickRuleBackendCreate

func NewStickRuleBackendCreate(backendName string, rule *models.StickRule, index int) Operation

NewStickRuleBackendCreate creates an operation to create a stick rule in a backend.

func NewStickRuleBackendDelete

func NewStickRuleBackendDelete(backendName string, rule *models.StickRule, index int) Operation

NewStickRuleBackendDelete creates an operation to delete a stick rule from a backend.

func NewStickRuleBackendUpdate

func NewStickRuleBackendUpdate(backendName string, rule *models.StickRule, index int) Operation

NewStickRuleBackendUpdate creates an operation to update a stick rule in a backend.

func NewTCPCheckBackendCreate

func NewTCPCheckBackendCreate(backendName string, check *models.TCPCheck, index int) Operation

NewTCPCheckBackendCreate creates an operation to create a TCP check in a backend.

func NewTCPCheckBackendDelete

func NewTCPCheckBackendDelete(backendName string, check *models.TCPCheck, index int) Operation

NewTCPCheckBackendDelete creates an operation to delete a TCP check from a backend.

func NewTCPCheckBackendUpdate

func NewTCPCheckBackendUpdate(backendName string, check *models.TCPCheck, index int) Operation

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

func NewTracesUpdate(traces *models.Traces) Operation

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

func NewUserCreate(userlistName string, user *models.User) Operation

NewUserCreate creates an operation to create a user in a userlist.

func NewUserDelete

func NewUserDelete(userlistName string, user *models.User) Operation

NewUserDelete creates an operation to delete a user from a userlist.

func NewUserUpdate

func NewUserUpdate(userlistName string, user *models.User) Operation

NewUserUpdate creates an operation to update a user in a userlist.

func NewUserlistCreate

func NewUserlistCreate(userlist *models.Userlist) Operation

NewUserlistCreate creates an operation to create a userlist section.

func NewUserlistDelete

func NewUserlistDelete(userlist *models.Userlist) Operation

NewUserlistDelete creates an operation to delete a userlist section.

func NewWAFGlobalCreate

func NewWAFGlobalCreate(wafGlobal *v32ee.WafGlobal) Operation

NewWAFGlobalCreate creates an operation to create the WAF global configuration. WAF global is a singleton section (only one per configuration).

func NewWAFGlobalDelete

func NewWAFGlobalDelete(wafGlobal *v32ee.WafGlobal) Operation

NewWAFGlobalDelete creates an operation to delete the WAF global configuration.

func NewWAFGlobalUpdate

func NewWAFGlobalUpdate(wafGlobal *v32ee.WafGlobal) Operation

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 SingletonOp

type SingletonOp[TModel any, TAPI any] struct {
	// contains filtered or unexported fields
}

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

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 TopLevelOp

type TopLevelOp[TModel any, TAPI any] struct {
	// contains filtered or unexported fields
}

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

func (*TopLevelOp[TModel, TAPI]) Section

func (op *TopLevelOp[TModel, TAPI]) Section() string

func (*TopLevelOp[TModel, TAPI]) Type

func (op *TopLevelOp[TModel, TAPI]) Type() OperationType

Directories

Path Synopsis
Package executors provides pre-built executor functions for HAProxy configuration operations.
Package executors provides pre-built executor functions for HAProxy configuration operations.

Jump to

Keyboard shortcuts

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