Liking cljdoc? Tell your friends :D

lb.config

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.
raw docstring

add-proxyclj

(add-proxy config proxy-config)

Add a new proxy configuration.

Add a new proxy configuration.
sourceraw docstring

add-sni-route-to-proxyclj

(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.
sourceraw docstring

add-source-route-to-proxyclj

(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.
sourceraw docstring

compute-cumulative-weightsclj

(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]
sourceraw docstring

config->mapclj

(config->map config)

Convert parsed Config back to plain EDN map.

Convert parsed Config back to plain EDN map.
sourceraw docstring

config-diff-empty?clj

(config-diff-empty? diff)

Check if a ConfigDiff represents no changes.

Check if a ConfigDiff represents no changes.
sourceraw docstring

default-circuit-breaker-configclj

source

default-health-check-configclj

source

default-settingsclj

Default settings values.

Default settings values.
sourceraw docstring

diff-configsclj

(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.
sourceraw docstring

diff-listenclj

(diff-listen old-listen new-listen)

Compare two Listen records. Returns true if different.

Compare two Listen records.
Returns true if different.
sourceraw docstring

diff-proxyclj

(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.
sourceraw docstring

diff-settingsclj

(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.
sourceraw docstring

diff-sni-routesclj

(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]}.
sourceraw docstring

diff-source-routesclj

(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}]}.
sourceraw docstring

diff-target-groupclj

(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.
sourceraw docstring

dns-target-group?clj

(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.
sourceraw docstring

dns-target?clj

(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).
sourceraw docstring

format-configclj

(format-config config)

Format full configuration for display.

Format full configuration for display.
sourceraw docstring

format-proxyclj

(format-proxy proxy)

Format a proxy configuration for display.

Format a proxy configuration for display.
sourceraw docstring

format-target-groupclj

(format-target-group tg)

Format a TargetGroup for display.

Format a TargetGroup for display.
sourceraw docstring

get-proxyclj

(get-proxy config proxy-name)

Get a proxy configuration by name.

Get a proxy configuration by name.
sourceraw docstring

health-check->mapclj

(health-check->map hc)

Convert a HealthCheckConfig back to EDN format.

Convert a HealthCheckConfig back to EDN format.
sourceraw docstring

load-config-fileclj

(load-config-file path)

Load configuration from an EDN file.

Load configuration from an EDN file.
sourceraw docstring

make-simple-configclj

(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.
sourceraw docstring

make-single-target-groupclj

(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.
sourceraw docstring

make-weighted-target-groupclj

(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.
sourceraw docstring

parse-circuit-breaker-configclj

(parse-circuit-breaker-config cb-config-map)

Parse circuit breaker configuration, merging with defaults.

Parse circuit breaker configuration, merging with defaults.
sourceraw docstring

parse-configclj

(parse-config {:keys [proxies settings]})

Parse full configuration from EDN map.

Parse full configuration from EDN map.
sourceraw docstring

parse-dns-weighted-targetclj

(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.
sourceraw docstring

parse-health-check-configclj

(parse-health-check-config health-check-map global-defaults)

Parse health check configuration, merging with defaults.

Parse health check configuration, merging with defaults.
sourceraw docstring

parse-listenclj

(parse-listen {:keys [interfaces port]})

Parse listen configuration.

Parse listen configuration.
sourceraw docstring

parse-proxy-configclj

(parse-proxy-config {:keys [name listen default-target source-routes
                            sni-routes]})

Parse a single proxy configuration.

Parse a single proxy configuration.
sourceraw docstring

parse-settingsclj

(parse-settings settings)

Parse settings with defaults.

Parse settings with defaults.
sourceraw docstring

parse-sni-routeclj

(parse-sni-route {:keys [sni-hostname target targets]} 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.
sourceraw docstring

parse-source-routeclj

(parse-source-route {:keys [source target targets]} 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.
sourceraw docstring

parse-targetclj

(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.
sourceraw docstring

parse-target-groupclj

(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:

  • TargetGroup if all targets are IP-based
  • DNSTargetGroup if any targets use DNS hostnames
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
sourceraw docstring

parse-weighted-targetclj

(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.
sourceraw docstring

proxy-diff-empty?clj

(proxy-diff-empty? diff)

Check if a ProxyDiff represents no changes.

Check if a ProxyDiff represents no changes.
sourceraw docstring

remove-proxyclj

(remove-proxy config proxy-name)

Remove a proxy configuration by name.

Remove a proxy configuration by name.
sourceraw docstring

remove-sni-route-from-proxyclj

(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.
sourceraw docstring

remove-source-route-from-proxyclj

(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.
sourceraw docstring

save-config-fileclj

(save-config-file config path)

Save configuration to an EDN file.

Save configuration to an EDN file.
sourceraw docstring

sni-route->mapclj

(sni-route->map sr)

Convert an SNIRoute back to EDN format.

Convert an SNIRoute back to EDN format.
sourceraw docstring

summarize-diffclj

(summarize-diff diff)

Create a human-readable summary of a ConfigDiff.

Create a human-readable summary of a ConfigDiff.
sourceraw docstring

target-group->mapclj

(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.
sourceraw docstring

update-proxyclj

(update-proxy config proxy-name update-fn)

Update a proxy configuration by name.

Update a proxy configuration by name.
sourceraw docstring

update-settingsclj

(update-settings config new-settings)

Update global settings.

Update global settings.
sourceraw docstring

update-sni-route-in-proxyclj

(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.
sourceraw docstring

validate-configclj

(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>}
sourceraw docstring

validate-proxy-configclj

(validate-proxy-config proxy-map)

Validate a single proxy configuration.

Validate a single proxy configuration.
sourceraw docstring

validate-target-weights!clj

(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')
sourceraw docstring

validate-weightsclj

(validate-weights targets)

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
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
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close