Liking cljdoc? Tell your friends :D

lb.core

Core API for the eBPF load balancer. Provides high-level functions for initialization, configuration, and management.

Core API for the eBPF load balancer.
Provides high-level functions for initialization, configuration, and management.
raw docstring

-mainclj

(-main & args)

Main entry point.

Main entry point.
sourceraw docstring

add-proxy!clj

(add-proxy! proxy-config)

Add a new proxy configuration at runtime. Now supports weighted load balancing with TargetGroup records.

Add a new proxy configuration at runtime.
Now supports weighted load balancing with TargetGroup records.
sourceraw docstring

add-sni-route!clj

(add-sni-route! proxy-name hostname target)

Add an SNI route to a proxy for TLS hostname-based routing. hostname: TLS SNI hostname to match (e.g., "api.example.com") target can be:

  • Single target: {:ip "10.0.0.1" :port 8443}
  • Weighted targets: [{:ip "10.0.0.1" :port 8443 :weight 50} {:ip "10.0.0.2" :port 8443 :weight 50}]
Add an SNI route to a proxy for TLS hostname-based routing.
hostname: TLS SNI hostname to match (e.g., "api.example.com")
target can be:
- Single target: {:ip "10.0.0.1" :port 8443}
- Weighted targets: [{:ip "10.0.0.1" :port 8443 :weight 50}
                     {:ip "10.0.0.2" :port 8443 :weight 50}]
sourceraw docstring

add-source-route!clj

(add-source-route! proxy-name source target)

Add a source route to a proxy. target can be:

  • Single target: {:ip "10.0.0.1" :port 8080}
  • Weighted targets: [{:ip "10.0.0.1" :port 8080 :weight 50} {:ip "10.0.0.2" :port 8080 :weight 50}]
Add a source route to a proxy.
target can be:
- Single target: {:ip "10.0.0.1" :port 8080}
- Weighted targets: [{:ip "10.0.0.1" :port 8080 :weight 50}
                     {:ip "10.0.0.2" :port 8080 :weight 50}]
sourceraw docstring

attach-interfaces!clj

(attach-interfaces! interfaces)

Attach proxy programs to network interfaces.

Attach proxy programs to network interfaces.
sourceraw docstring

clear-connections!clj

(clear-connections!)

Clear all tracked connections.

Clear all tracked connections.
sourceraw docstring

cli-optionsclj

source

detach-interfaces!clj

(detach-interfaces! interfaces)

Detach proxy programs from network interfaces.

Detach proxy programs from network interfaces.
sourceraw docstring

disable-stats!clj

(disable-stats!)

Disable statistics collection.

Disable statistics collection.
sourceraw docstring

enable-stats!clj

(enable-stats!)

Enable statistics collection.

Enable statistics collection.
sourceraw docstring

error-msgclj

(error-msg errors)
source

get-all-health-statusclj

(get-all-health-status)

Get health status for all proxies.

Get health status for all proxies.
sourceraw docstring

get-connection-countclj

(get-connection-count)

Get the number of active connections.

Get the number of active connections.
sourceraw docstring

get-connection-statsclj

(get-connection-stats)

Get aggregated connection statistics.

Get aggregated connection statistics.
sourceraw docstring

get-connectionsclj

(get-connections)

Get all active connections.

Get all active connections.
sourceraw docstring

get-health-statusclj

(get-health-status proxy-name)

Get health status for a specific proxy.

Get health status for a specific proxy.
sourceraw docstring

get-stateclj

(get-state)

Get the current proxy state.

Get the current proxy state.
sourceraw docstring

get-statusclj

(get-status)

Get current proxy status.

Get current proxy status.
sourceraw docstring

health-check-enabled?clj

(health-check-enabled?)

Check if health checking is enabled.

Check if health checking is enabled.
sourceraw docstring

init!clj

(init! config
       &
       {:keys [max-routes max-connections ringbuf-size]
        :or
          {max-routes 10000 max-connections 100000 ringbuf-size (* 256 1024)}})

Initialize the eBPF reverse proxy.

Parameters: config - Configuration object (from config/parse-config or config/load-config-file)

Options: :max-routes - Maximum number of source routes :max-connections - Maximum concurrent connections :ringbuf-size - Ring buffer size for stats

Returns the proxy state map.

Initialize the eBPF reverse proxy.

Parameters:
  config - Configuration object (from config/parse-config or config/load-config-file)

Options:
  :max-routes - Maximum number of source routes
  :max-connections - Maximum concurrent connections
  :ringbuf-size - Ring buffer size for stats

Returns the proxy state map.
sourceraw docstring

list-all-sni-routesclj

(list-all-sni-routes)

List all SNI routes from BPF map. Note: Returns hostname hashes since original hostnames aren't stored in BPF.

List all SNI routes from BPF map.
Note: Returns hostname hashes since original hostnames aren't stored in BPF.
sourceraw docstring

list-attached-interfacesclj

(list-attached-interfaces)

List currently attached interfaces.

List currently attached interfaces.
sourceraw docstring

list-sni-routesclj

(list-sni-routes proxy-name)

List all SNI routes for a proxy. Returns a sequence of {:hostname :target-group} maps.

List all SNI routes for a proxy.
Returns a sequence of {:hostname :target-group} maps.
sourceraw docstring

(print-config)

Print current configuration.

Print current configuration.
sourceraw docstring

(print-connections)

Print active connections.

Print active connections.
sourceraw docstring

(print-health-status)

Print health status for all proxies.

Print health status for all proxies.
sourceraw docstring

(print-status)

Print current load balancer status.

Print current load balancer status.
sourceraw docstring

remove-proxy!clj

(remove-proxy! proxy-name)

Remove a proxy configuration at runtime.

Remove a proxy configuration at runtime.
sourceraw docstring

remove-sni-route!clj

(remove-sni-route! proxy-name hostname)

Remove an SNI route from a proxy.

Remove an SNI route from a proxy.
sourceraw docstring

remove-source-route!clj

(remove-source-route! proxy-name source)

Remove a source route from a proxy.

Remove a source route from a proxy.
sourceraw docstring

running?clj

(running?)

Check if the proxy is currently running.

Check if the proxy is currently running.
sourceraw docstring

shutdown!clj

(shutdown!)

Shutdown the reverse proxy and release all resources.

Shutdown the reverse proxy and release all resources.
sourceraw docstring

start-stats-stream!clj

(start-stats-stream!)

Start streaming statistics events.

Start streaming statistics events.
sourceraw docstring

stats-enabled?clj

(stats-enabled?)

Check if statistics collection is enabled.

Check if statistics collection is enabled.
sourceraw docstring

stop-stats-stream!clj

(stop-stats-stream!)

Stop streaming statistics events.

Stop streaming statistics events.
sourceraw docstring

subscribe-to-statsclj

(subscribe-to-stats)

Subscribe to the stats stream. Returns a channel.

Subscribe to the stats stream. Returns a channel.
sourceraw docstring

usageclj

(usage options-summary)
source

validate-argsclj

(validate-args args)
source

with-lb-statecljmacro

(with-lb-state [binding] & body)

Execute body with load balancer state bound to the specified binding. Returns nil if the load balancer is not running.

Example: (with-lb-state [state] (let [{:keys [maps config]} state] ;; work with state ))

Execute body with load balancer state bound to the specified binding.
Returns nil if the load balancer is not running.

Example:
  (with-lb-state [state]
    (let [{:keys [maps config]} state]
      ;; work with state
      ))
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