Documentation ¶
Index ¶
- Constants
- func Bool(name string, annotations ...map[string]string) (out bool, err error)
- func CheckBackendConfigSnippetError(configErr error, cfgDir string) (rerun bool, err error)
- func DisableConfigSnippets(disableConfigSnippets string)
- func InitCfgSnippet()
- func Int(name string, annotations ...map[string]string) (out int, err error)
- func IsConfigSnippetDisabled(name CfgSnippetType) bool
- func ModelBackend(name, defaultNS string, k store.K8s, annotations ...map[string]string) (backend *models.Backend, err error)
- func ModelDefaults(name, defaultNS string, k store.K8s, annotations ...map[string]string) (defaults *models.Defaults, err error)
- func ModelGlobal(name, defaultNS string, k store.K8s, annotations ...map[string]string) (global *models.Global, err error)
- func ModelLog(name, defaultNS string, k store.K8s, annotations ...map[string]string) (log models.LogTargets, err error)
- func ParseBool(name string, annotations ...map[string]string) (out string, err error)
- func RemoveBackendCfgSnippet(backend string)
- func Secret(name, defaultNs string, k store.K8s, annotations ...map[string]string) (secret *store.Secret, err error)
- func SetDefaultValue(annotation, value string)
- func String(name string, annotations ...map[string]string) string
- func Timeout(name string, annotations ...map[string]string) (out *int64, err error)
- func UpdateFrontendCfgSnippet(api api.HAProxyClient, frontends ...string) (updated []string, err error)
- func UpdateGlobalCfgSnippet(api api.HAProxyClient) (updated []string, err error)
- type Annotation
- type Annotations
- type CfgSnippet
- type CfgSnippetType
- type ConfigSnippetHandler
- type ConfigSnippetOptions
Constants ¶
const ( COMMENT_CFG_SNIPPET_END = " ###_config-snippet_### END" COMMENT_CFG_SNIPPET_BEGIN = " ###_config-snippet_### BEGIN" BACKEND = "backend" COMMMENT_INGRESS_PREFIX = "### ingress:" COMMENT_ENDING = " ###" COMMENT_CONFIGMAP_PREFIX = "### configmap:" COMMMENT_SERVICE_PREFIX = "### service:" SERVICE_NAME_PREFIX = "svc_" INGRESS_NAME_PREFIX = "ing_" )
Variables ¶
This section is empty.
Functions ¶
func CheckBackendConfigSnippetError ¶ added in v1.11.0
func DisableConfigSnippets ¶ added in v1.11.0
func DisableConfigSnippets(disableConfigSnippets string)
DisableConfigSnippets fills a map[cfgSnippetType]struct{} of disabled config snippet types: - backend/frontend/global and store it in the global var cfgSnippet from a comma separated list : all,backend,frontend,global. If "all" is present in the list, then: backend, frontend and global config snippets are disabled.
func InitCfgSnippet ¶ added in v1.11.0
func InitCfgSnippet()
func IsConfigSnippetDisabled ¶ added in v1.11.0
func IsConfigSnippetDisabled(name CfgSnippetType) bool
func ModelBackend ¶
func ModelBackend(name, defaultNS string, k store.K8s, annotations ...map[string]string) (backend *models.Backend, err error)
ModelBackend takes an annotation holding the path of a backend cr and returns corresponding Backend model
func ModelDefaults ¶
func ModelDefaults(name, defaultNS string, k store.K8s, annotations ...map[string]string) (defaults *models.Defaults, err error)
ModelDefaults takes an annotation holding the path of a defaults cr and returns corresponding Defaults model
func ModelGlobal ¶
func ModelGlobal(name, defaultNS string, k store.K8s, annotations ...map[string]string) (global *models.Global, err error)
ModelGlobal takes an annotation holding the path of a global cr and returns corresponding Global model
func ModelLog ¶
func ModelLog(name, defaultNS string, k store.K8s, annotations ...map[string]string) (log models.LogTargets, err error)
ModelLog takes an annotation holding the path of a global cr and returns corresponding LogTargerts model
func RemoveBackendCfgSnippet ¶
func RemoveBackendCfgSnippet(backend string)
func SetDefaultValue ¶
func SetDefaultValue(annotation, value string)
func UpdateFrontendCfgSnippet ¶
func UpdateFrontendCfgSnippet(api api.HAProxyClient, frontends ...string) (updated []string, err error)
func UpdateGlobalCfgSnippet ¶
func UpdateGlobalCfgSnippet(api api.HAProxyClient) (updated []string, err error)
Types ¶
type Annotation ¶
type Annotations ¶
type Annotations interface { GlobalCfgSnipp() []Annotation Global(g *models.Global, l *models.LogTargets) []Annotation Defaults(d *models.Defaults) []Annotation Backend(b *models.Backend, s store.K8s, c certs.Certificates) []Annotation Frontend(i *store.Ingress, r *rules.List, m maps.Maps) []Annotation Secret(name, defaultNs string, k store.K8s, annotations ...map[string]string) (secret *store.Secret, err error) Timeout(name string, annotations ...map[string]string) (out *int64, err error) String(name string, annotations ...map[string]string) string }
func New ¶
func New() Annotations
type CfgSnippet ¶
type CfgSnippet struct {
// contains filtered or unexported fields
}
func NewCfgSnippet ¶ added in v1.11.0
func NewCfgSnippet(opts ConfigSnippetOptions) *CfgSnippet
func (*CfgSnippet) GetName ¶
func (a *CfgSnippet) GetName() string
func (*CfgSnippet) SetService ¶ added in v1.11.0
func (a *CfgSnippet) SetService(service *store.Service)
type CfgSnippetType ¶ added in v1.11.0
type CfgSnippetType string
CfgSnippetType represents type of a config snippet
const ( // CfgSnippetType values ConfigSnippetBackend CfgSnippetType = "backend" ConfigSnippetFrontend CfgSnippetType = "frontend" ConfigSnippetGlobal CfgSnippetType = "global" )
type ConfigSnippetHandler ¶ added in v1.11.0
type ConfigSnippetHandler struct{}
func (ConfigSnippetHandler) Update ¶ added in v1.11.0
func (h ConfigSnippetHandler) Update(k store.K8s, api haproxy.HAProxy, ann Annotations) (err error)