diff options
author | HuabingZhao <zhao.huabing@zte.com.cn> | 2018-02-28 11:10:50 +0800 |
---|---|---|
committer | HuabingZhao <zhao.huabing@zte.com.cn> | 2018-02-28 11:10:56 +0800 |
commit | d77dc45e7eee74a7c39e850070103fcbbc8f38b0 (patch) | |
tree | 42ba2358aa53a99e30d7f493a619a40b67f9ec4a /openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua | |
parent | eba92f2ec4bd3783633fe2408eeae582b811c70a (diff) |
Support IP Hash LB policy
Issue-ID: MSB-154
Change-Id: I11b8e3a314c6045183971bf2207b9ccee7df10c2
Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua')
-rw-r--r-- | openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua b/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua index 6fa8d39..00996c4 100644 --- a/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua +++ b/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua @@ -1,6 +1,6 @@ --[[
- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+ Copyright (C) 2017-2018 ZTE, Inc. and others. All rights reserved. (ZTE)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,6 +19,10 @@ local _M = {}
_M._VERSION = '1.0.0'
+local pl_stringx = require "pl.stringx"
+local split = pl_stringx.split
+local strip = pl_stringx.strip
+
function _M.mark_empty_as_nil(t)
if t == "" then
return nil
@@ -27,4 +31,14 @@ function _M.mark_empty_as_nil(t) end
end
-return _M
\ No newline at end of file +--- splits a string.
+-- just a placeholder to the penlight `pl.stringx.split` function
+-- @function split
+_M.split = split
+
+--- strips whitespace from a string.
+-- just a placeholder to the penlight `pl.stringx.strip` function
+-- @function strip
+_M.strip = strip
+
+return _M
|