Configuration management for the load balancer. Handles configuration data structures, validation, and persistence.
Configuration management for the load balancer. Handles configuration data structures, validation, and persistence.
(add-proxy config proxy-config)Add a new proxy configuration.
Add a new proxy configuration.
(add-sni-route-to-proxy config proxy-name sni-route)Add an SNI route to a proxy. sni-route can be an SNIRoute record or a map with :sni-hostname and :target/:targets.
Add an SNI route to a proxy. sni-route can be an SNIRoute record or a map with :sni-hostname and :target/:targets.
(add-source-route-to-proxy config proxy-name source-route)Add a source route to a proxy. source-route can be a SourceRoute record or a map with :source and :target/:targets.
Add a source route to a proxy. source-route can be a SourceRoute record or a map with :source and :target/:targets.
(compute-cumulative-weights targets)Compute cumulative weights from a sequence of WeightedTarget records. Example: targets with weights [50, 30, 20] -> cumulative [50, 80, 100]
Compute cumulative weights from a sequence of WeightedTarget records. Example: targets with weights [50, 30, 20] -> cumulative [50, 80, 100]
(config->map config)Convert parsed Config back to plain EDN map.
Convert parsed Config back to plain EDN map.
(config-diff-empty? diff)Check if a ConfigDiff represents no changes.
Check if a ConfigDiff represents no changes.
(diff-configs old-config new-config)Compare two Config records. Returns ConfigDiff record describing all changes.
Compare two Config records. Returns ConfigDiff record describing all changes.
(diff-listen old-listen new-listen)Compare two Listen records. Returns true if different.
Compare two Listen records. Returns true if different.
(diff-proxy old-proxy new-proxy)Compare two ProxyConfig records with the same name. Returns ProxyDiff record describing changes.
Compare two ProxyConfig records with the same name. Returns ProxyDiff record describing changes.
(diff-settings old-settings new-settings)Compare two Settings records. Returns map of {:field {:old v1 :new v2}} for changed fields, or empty map if identical.
Compare two Settings records.
Returns map of {:field {:old v1 :new v2}} for changed fields, or empty map if identical.(diff-sni-routes old-routes new-routes)Compare SNI route vectors. Returns {:added [SNIRoute] :removed [hostname]}.
Compare SNI route vectors.
Returns {:added [SNIRoute] :removed [hostname]}.(diff-source-routes old-routes new-routes)Compare source route vectors. Returns {:added [SourceRoute] :removed [{:source :prefix-len}]}.
Compare source route vectors.
Returns {:added [SourceRoute] :removed [{:source :prefix-len}]}.(diff-target-group old-tg new-tg)Compare two TargetGroup records. Returns nil if identical, {:old :new} if different.
Compare two TargetGroup records.
Returns nil if identical, {:old :new} if different.(dns-target-group? target-group)Check if a parsed target group contains DNS targets. Returns true for DNSTargetGroup, false for TargetGroup.
Check if a parsed target group contains DNS targets. Returns true for DNSTargetGroup, false for TargetGroup.
(dns-target? target-spec)Check if a target specification uses DNS (has :host instead of :ip).
Check if a target specification uses DNS (has :host instead of :ip).
(format-config config)Format full configuration for display.
Format full configuration for display.
(format-proxy proxy)Format a proxy configuration for display.
Format a proxy configuration for display.
(format-target-group tg)Format a TargetGroup for display.
Format a TargetGroup for display.
(get-proxy config proxy-name)Get a proxy configuration by name.
Get a proxy configuration by name.
(health-check->map hc)Convert a HealthCheckConfig back to EDN format.
Convert a HealthCheckConfig back to EDN format.
(load-config-file path)Load configuration from an EDN file.
Load configuration from an EDN file.
(make-simple-config {:keys [name interface port target-ip target-port
stats-enabled health-check-enabled]
:or {name "default"
interface "eth0"
port 80
target-ip "127.0.0.1"
target-port 8080
stats-enabled false
health-check-enabled false}})Create a simple single-proxy configuration. Useful for quick testing or simple deployments.
Create a simple single-proxy configuration. Useful for quick testing or simple deployments.
(make-single-target-group ip port)(make-single-target-group ip port health-check)Create a TargetGroup with a single target. Convenience function for simple configurations.
Create a TargetGroup with a single target. Convenience function for simple configurations.
(make-weighted-target-group targets)Create a TargetGroup with multiple weighted targets. targets should be a sequence of {:ip :port :weight :health-check} maps. Validates that weights sum to 100.
Create a TargetGroup with multiple weighted targets.
targets should be a sequence of {:ip :port :weight :health-check} maps.
Validates that weights sum to 100.(parse-circuit-breaker-config cb-config-map)Parse circuit breaker configuration, merging with defaults.
Parse circuit breaker configuration, merging with defaults.
(parse-config {:keys [proxies settings]})Parse full configuration from EDN map.
Parse full configuration from EDN map.
(parse-dns-weighted-target target-map)(parse-dns-weighted-target {:keys [host port weight dns-refresh-seconds
health-check]}
global-health-defaults)Parse a DNS-backed target map to DNSWeightedTarget record. The hostname will be resolved at runtime by the DNS manager. global-health-defaults: optional global health check defaults from settings.
Parse a DNS-backed target map to DNSWeightedTarget record. The hostname will be resolved at runtime by the DNS manager. global-health-defaults: optional global health check defaults from settings.
(parse-health-check-config health-check-map global-defaults)Parse health check configuration, merging with defaults.
Parse health check configuration, merging with defaults.
(parse-listen {:keys [interfaces port]})Parse listen configuration.
Parse listen configuration.
(parse-load-balancing-config lb-config-map)Parse load balancing configuration, merging with defaults. Config keys use lb- prefix in specs but normal names in config maps.
Parse load balancing configuration, merging with defaults. Config keys use lb- prefix in specs but normal names in config maps.
(parse-proxy-config {:keys [name listen default-target source-routes sni-routes
session-persistence]})Parse a single proxy configuration.
Parse a single proxy configuration.
(parse-settings settings)Parse settings with defaults.
Parse settings with defaults.
(parse-sni-route {:keys [sni-hostname target targets session-persistence]}
proxy-name)Parse an SNI route for TLS SNI-based routing. Supports both :target (single) and :targets (weighted array) formats.
Parse an SNI route for TLS SNI-based routing. Supports both :target (single) and :targets (weighted array) formats.
(parse-source-route {:keys [source target targets session-persistence]}
proxy-name)Parse a source route, resolving hostname if necessary. Supports both :target (single) and :targets (weighted array) formats.
Parse a source route, resolving hostname if necessary. Supports both :target (single) and :targets (weighted array) formats.
(parse-target {:keys [ip port]})Parse a single target map to Target record with resolved IP. Kept for backward compatibility.
Parse a single target map to Target record with resolved IP. Kept for backward compatibility.
(parse-target-group target-spec context-msg)Parse a target specification into a TargetGroup or DNSTargetGroup. Accepts either a single target map or a vector of targets. Validates weights for multi-target groups.
Returns:
Parse a target specification into a TargetGroup or DNSTargetGroup. Accepts either a single target map or a vector of targets. Validates weights for multi-target groups. Returns: - TargetGroup if all targets are IP-based - DNSTargetGroup if any targets use DNS hostnames
(parse-weighted-target target-map)(parse-weighted-target {:keys [ip port weight health-check]}
global-health-defaults)Parse a target map to WeightedTarget record with resolved IP. If weight is not specified, defaults to 100 (for single target scenarios). global-health-defaults: optional global health check defaults from settings.
Parse a target map to WeightedTarget record with resolved IP. If weight is not specified, defaults to 100 (for single target scenarios). global-health-defaults: optional global health check defaults from settings.
(proxy-diff-empty? diff)Check if a ProxyDiff represents no changes.
Check if a ProxyDiff represents no changes.
(remove-proxy config proxy-name)Remove a proxy configuration by name.
Remove a proxy configuration by name.
(remove-sni-route-from-proxy config proxy-name hostname)Remove an SNI route from a proxy by hostname.
Remove an SNI route from a proxy by hostname.
(remove-source-route-from-proxy config proxy-name source-ip prefix-len)Remove a source route from a proxy by source IP/prefix.
Remove a source route from a proxy by source IP/prefix.
(save-config-file config path)Save configuration to an EDN file.
Save configuration to an EDN file.
(sni-route->map sr)Convert an SNIRoute back to EDN format.
Convert an SNIRoute back to EDN format.
(summarize-diff diff)Create a human-readable summary of a ConfigDiff.
Create a human-readable summary of a ConfigDiff.
(target-group->map tg)Convert a TargetGroup back to EDN format. Returns a single target map if only one target, otherwise a vector.
Convert a TargetGroup back to EDN format. Returns a single target map if only one target, otherwise a vector.
(update-proxy config proxy-name update-fn)Update a proxy configuration by name.
Update a proxy configuration by name.
(update-settings config new-settings)Update global settings.
Update global settings.
(update-sni-route-in-proxy config proxy-name hostname new-sni-route)Update an existing SNI route in a proxy by hostname. new-sni-route should be a map with :sni-hostname and :target/:targets.
Update an existing SNI route in a proxy by hostname. new-sni-route should be a map with :sni-hostname and :target/:targets.
(validate-config config-map)Validate configuration map against spec. Returns {:valid true :config <parsed>} or {:valid false :errors <explain-data>}
Validate configuration map against spec.
Returns {:valid true :config <parsed>} or {:valid false :errors <explain-data>}(validate-proxy-config proxy-map)Validate a single proxy configuration.
Validate a single proxy configuration.
(validate-target-weights! targets context-msg)Validate weights for targets, throwing on error. context-msg should describe where the targets are (e.g., 'proxy web default-target')
Validate weights for targets, throwing on error. context-msg should describe where the targets are (e.g., 'proxy web default-target')
(validate-weights targets)Validate weights for a group of targets. Returns nil if valid, error message string if invalid.
Rules:
Validate weights for a group of targets. Returns nil if valid, error message string if invalid. Rules: - Single target: weight is optional and ignored - Multiple targets: all must have explicit weights that sum to 100
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |