We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09b3753 commit 3f0cfa6Copy full SHA for 3f0cfa6
src/clojure/nginx/clojure/core.clj
@@ -339,3 +339,15 @@ When a message comes the callback function will be invoked. e.g.
339
(callback message att))))]
340
(fn [] (.unsubscribe topic pd))))
341
(destory! [topic] (.destory topic)))
342
+
343
+(defn balancer-result
344
+ "Build a balancer result for a load balancer.
345
+ `idx-or-url can be an index of the upstream servers list or the url string.
346
+ e.g. (balancer-result 3) , (balancer-result \"192.168.3.5:8071\")
347
+ "
348
+ [idx-or-url]
349
+ (cond
350
+ (instance? String idx-or-url) {:status 200, :body idx-or-url}
351
+ (instance? Integer idx-or-url) {:status 200, :body idx-or-url}
352
+ :else
353
+ {:status 500}))
0 commit comments