haproxy

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAP_SNI         = "sni"
	MAP_HOST        = "host"
	MAP_PATH_EXACT  = "path-exact"
	MAP_PATH_PREFIX = "path-prefix"
)
View Source
const (
	CREATED   ruleState = 0
	TO_CREATE ruleState = 1
	TO_DELETE ruleState = 2
)

nolint: golint,stylecheck

Variables

View Source
var HTTPACLVar = "txn.path_match"

HTTPACLVar used to match against RuleID in haproxy http frontend

View Source
var TCPACLVar = "txn.sni_match"

TCPACLVar used to match against RuleID in haproxy ssl frontend

Functions

func GetMapPath added in v1.5.0

func GetMapPath(name string) string

Types

type Certificates added in v1.5.0

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

func NewCertificates added in v1.5.0

func NewCertificates(caDir, ftDir, bdDir string) *Certificates

func (*Certificates) Clean added in v1.5.0

func (c *Certificates) Clean()

func (*Certificates) FrontendCertsEnabled added in v1.5.0

func (c *Certificates) FrontendCertsEnabled() bool

func (*Certificates) HandleTLSSecret added in v1.5.0

func (c *Certificates) HandleTLSSecret(secret *store.Secret, secretType SecretType) (certPath string, err error)

func (*Certificates) Refresh added in v1.5.0

func (c *Certificates) Refresh() (reload bool)

Refresh removes unused certs from HAProxyCertDir

func (*Certificates) Updated added in v1.7.0

func (c *Certificates) Updated() (reload bool)

type Maps

type Maps map[string]*mapFile

func NewMapFiles

func NewMapFiles(path string) *Maps

func (Maps) AppendRow added in v1.4.6

func (m Maps) AppendRow(name string, row string)

AppendRow appends row to mapFile

func (Maps) Clean

func (m Maps) Clean()

func (Maps) Exists added in v1.5.5

func (m Maps) Exists(name string) bool

func (Maps) Refresh

func (m Maps) Refresh(client api.HAProxyClient) (reload bool)

type Rule added in v1.5.0

type Rule interface {
	Create(client api.HAProxyClient, frontend *models.Frontend, ingressACL string) error
	GetType() RuleType
}

type RuleID added in v1.5.0

type RuleID string

RuleID uniquely identify a HAProxy Rule

func GetID added in v1.7.0

func GetID(rule Rule) RuleID

type RuleType added in v1.5.0

type RuleType int

Order matters ! Rules will be evaluated by HAProxy in the defined order.

const (
	REQ_ACCEPT_CONTENT RuleType = iota
	REQ_INSPECT_DELAY
	REQ_PROXY_PROTOCOL
	REQ_SET_VAR
	REQ_SET_SRC
	REQ_DENY
	REQ_TRACK
	REQ_AUTH
	REQ_RATELIMIT
	REQ_CAPTURE
	REQ_REDIRECT
	REQ_FORWARDED_PROTO
	REQ_SET_HEADER
	REQ_SET_HOST
	REQ_PATH_REWRITE
	RES_SET_HEADER
)

nolint: golint,stylecheck

type Rules added in v1.5.0

type Rules []Rule

func (*Rules) Add added in v1.7.0

func (r *Rules) Add(rule Rule)

type SecretCtx added in v1.5.0

type SecretCtx struct {
	Namespace  string
	Name       string
	SecretType SecretType
}

type SecretType added in v1.5.0

type SecretType int
const (
	NONE_CERT SecretType = iota
	FT_CERT
	FT_DEFAULT_CERT
	BD_CERT
	CA_CERT
)

type SectionRules added in v1.7.0

type SectionRules map[string]*ruleset

func NewRules added in v1.5.0

func NewRules() SectionRules

func (SectionRules) AddRule added in v1.7.0

func (r SectionRules) AddRule(rule Rule, ingressRule bool, frontend string) error

func (SectionRules) Clean added in v1.7.0

func (r SectionRules) Clean(frontends ...string)

func (SectionRules) DeleteFrontend added in v1.7.0

func (r SectionRules) DeleteFrontend(frontend string)

func (SectionRules) Refresh added in v1.7.0

func (r SectionRules) Refresh(client api.HAProxyClient) (reload bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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