Support IP Hash LB policy
[msb/apigateway.git] / openresty-ext / src / assembly / resources / openresty / nginx / luaext / lib / utils / str_util.lua
index 6fa8d39..00996c4 100644 (file)
@@ -1,6 +1,6 @@
 --[[\r
 \r
-    Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)\r
+    Copyright (C) 2017-2018 ZTE, Inc. and others. All rights reserved. (ZTE)\r
 \r
     Licensed under the Apache License, Version 2.0 (the "License");\r
     you may not use this file except in compliance with the License.\r
 local _M = {}\r
 _M._VERSION = '1.0.0'\r
 \r
+local pl_stringx = require "pl.stringx"\r
+local split      = pl_stringx.split\r
+local strip      = pl_stringx.strip\r
+\r
 function _M.mark_empty_as_nil(t)\r
        if t == "" then\r
                return nil\r
@@ -27,4 +31,14 @@ function _M.mark_empty_as_nil(t)
        end\r
 end\r
 \r
-return _M
\ No newline at end of file
+--- splits a string.\r
+-- just a placeholder to the penlight `pl.stringx.split` function\r
+-- @function split\r
+_M.split = split\r
+\r
+--- strips whitespace from a string.\r
+-- just a placeholder to the penlight `pl.stringx.strip` function\r
+-- @function strip\r
+_M.strip = strip\r
+\r
+return _M\r