Documentation ¶
Index ¶
- type BackendConfig
- type ConfigOverwrite
- type ConfigValue
- type Map
- type MapBuilder
- type Mapper
- func (c *Mapper) AddAnnotations(source *Source, link hatypes.PathLink, ann map[string]string) (conflicts []string)
- func (c *Mapper) Get(key string) *ConfigValue
- func (c *Mapper) GetBackendConfig(backend *hatypes.Backend, keys []string, overwrite ConfigOverwrite) []*BackendConfig
- func (c *Mapper) GetStrMap(key string) ([]*Map, bool)
- type Source
- type Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendConfig ¶
type BackendConfig struct { Paths hatypes.BackendPaths Config map[string]*ConfigValue }
BackendConfig ...
func (*BackendConfig) ConfigEquals ¶
func (b *BackendConfig) ConfigEquals(other map[string]*ConfigValue) bool
ConfigEquals ...
type ConfigOverwrite ¶
type ConfigOverwrite func(path *hatypes.BackendPath, values map[string]*ConfigValue) map[string]*ConfigValue
ConfigOverwrite ...
type ConfigValue ¶
ConfigValue ...
type Map ¶
Map ...
TODO rename URI to Hostpath -- currently this is a little mess. Fix also testCase data in order to represent a hostname+path. Hostname is the domain name. Path is the declared starting path on ingress Together they populate a map_beg() converter in order to match HAProxy's `base` sample fetch method.
type MapBuilder ¶
type MapBuilder struct {
// contains filtered or unexported fields
}
MapBuilder ...
func NewMapBuilder ¶
func NewMapBuilder(logger types.Logger, annPrefix string, annDefaults map[string]string) *MapBuilder
NewMapBuilder ...
type Mapper ¶
type Mapper struct { MapBuilder // contains filtered or unexported fields }
Mapper ...
func (*Mapper) AddAnnotations ¶
func (c *Mapper) AddAnnotations(source *Source, link hatypes.PathLink, ann map[string]string) (conflicts []string)
AddAnnotations ...
func (*Mapper) GetBackendConfig ¶
func (c *Mapper) GetBackendConfig(backend *hatypes.Backend, keys []string, overwrite ConfigOverwrite) []*BackendConfig
GetBackendConfig builds a generic BackendConfig using annotation maps registered previously as its data source
An annotation map is a `map[<uri>]<value>` collected on ingress/service parsing phase. A HAProxy backend need a group of annotation keys - ie a group of maps - grouped by URI in order to create and apply ACLs.
The rule of thumb on the final BackendConfig array is:
- Every backend path must be declared, so a HAProxy method can just `if len(BackendConfig) > 1 then need-acl`;
- Added annotation means declared annotation (ingress, service or default) so the config reader `Get<Type>FromMap()“ can distinguish between `undeclared` and `declared empty`.
type Updater ¶
type Updater interface { UpdateGlobalConfig(haproxyConfig haproxy.Config, mapper *Mapper) UpdateHostConfig(host *hatypes.Host, mapper *Mapper) UpdateBackendConfig(backend *hatypes.Backend, mapper *Mapper) }
Updater ...
func NewUpdater ¶
func NewUpdater(haproxy haproxy.Config, options *ingtypes.ConverterOptions) Updater
NewUpdater ...