haproxy

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 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"
)

Variables

View Source
var ErrCertNotFound = errors.New("notFound")
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(k8s store.K8s, secretCtx SecretCtx) (certPath string, updated bool, err error)

func (*Certificates) Refresh added in v1.5.0

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

Refresh removes unused certs from HAProxyCertDir

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

type RuleStatus added in v1.5.0

type RuleStatus int

RuleStatus describing Rule creation

const (
	// exclusive states
	CREATED   RuleStatus = 0
	TO_CREATE RuleStatus = 1
	TO_DELETE RuleStatus = 2
	// non exclusive states
	INGRESS RuleStatus = 4
)

nolint: golint,stylecheck

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_REQUEST_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 struct {
	// contains filtered or unexported fields
}

func NewRules added in v1.5.0

func NewRules() *Rules

func (Rules) AddRule added in v1.5.0

func (r Rules) AddRule(rule Rule, ingressName string, frontends ...string) error

func (Rules) Clean added in v1.5.0

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

func (Rules) DeleteFrontend added in v1.5.2

func (r Rules) DeleteFrontend(frontend string)

func (Rules) GetIngressRuleIDs added in v1.5.0

func (r Rules) GetIngressRuleIDs(ingress string) (ruleIDs []RuleID)

func (Rules) Refresh added in v1.5.0

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

type SecretCtx added in v1.5.0

type SecretCtx struct {
	DefaultNS  string
	SecretPath 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
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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