在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):openresty/lua-resty-core开源软件地址(OpenSource Url):https://github.com/openresty/lua-resty-core开源编程语言(OpenSource Language):Lua 98.7%开源软件介绍(OpenSource Introduction):Namelua-resty-core - New FFI-based Lua API for ngx_http_lua_module and/or ngx_stream_lua_module Table of Contents
StatusThis library is production ready. SynopsisThis library is automatically loaded by default in OpenResty 1.15.8.1. This behavior can be disabled via the lua_load_resty_core directive, but note that the use of this library is vividly recommended, as its FFI implementation is both faster, safer, and more complete than the Lua C API of the ngx_lua module. If you are using an older version of OpenResty, you must load this library like so: # nginx.conf
http {
# you do NOT need to configure the following line when you
# are using the OpenResty bundle 1.4.3.9+.
lua_package_path "/path/to/lua-resty-core/lib/?.lua;;";
init_by_lua_block {
require "resty.core"
collectgarbage("collect") -- just to collect any garbage
}
...
} DescriptionThis pure Lua library reimplements part of the ngx_lua module's Nginx API for Lua with LuaJIT FFI and installs the new FFI-based Lua API into the ngx.* and ndk.* namespaces used by the ngx_lua module. In addition, this Lua library implements any significant new Lua APIs of the ngx_lua module as proper Lua modules, like ngx.semaphore and ngx.balancer. The FFI-based Lua API can work with LuaJIT's JIT compiler. ngx_lua's default API is based on the standard Lua C API, which will never be JIT compiled and the user Lua code is always interpreted (slowly). Support for the new ngx_stream_lua_module has also begun. This library is shipped with the OpenResty bundle by default. So you do not really need to worry about the dependencies and requirements. PrerequisitesWARNING This library is included with every OpenResty release. You should use the bundled version of this library in the particular OpenResty release you are using. Otherwise you may run into serious compatibility issues.
API Implementedresty.core.hashresty.core.base64resty.core.uriresty.core.regexresty.core.exitresty.core.shdict
resty.core.varresty.core.ctxget_ctx_tablesyntax: ctx = resty.core.ctx.get_ctx_table(ctx?) Similar to ngx.ctx but it accepts an optional Notice: the resty.core.request
resty.core.responseresty.core.miscresty.core.time
resty.core.workerresty.core.phaseresty.core.ndkresty.core.socketresty.core.param
ngx.semaphoreThis Lua module implements a semaphore API for efficient "light thread" synchronization, which can work across different requests (but not across nginx worker processes). See the documentation for this Lua module for more details. ngx.balancerThis Lua module implements for defining dynamic upstream balancers in Lua. See the documentation for this Lua module for more details. ngx.sslThis Lua module provides a Lua API for controlling SSL certificates, private keys, SSL protocol versions, and etc in NGINX downstream SSL handshakes. See the documentation for this Lua module for more details. ngx.ssl.clienthelloThis Lua module provides a Lua API for post-processing SSL client hello message for NGINX downstream SSL connections. See the documentation for this Lua module for more details. ngx.ssl.sessionThis Lua module provides a Lua API for manipulating SSL session data and IDs for NGINX downstream SSL connections. See the documentation for this Lua module for more details. ngx.reThis Lua module provides a Lua API which implements convenience utilities for
the See the documentation for this Lua module for more details. ngx.respThis Lua module provides Lua API which could be used to handle HTTP response. See the documentation for this Lua module for more details. ngx.pipeThis module provides a Lua API to spawn processes and communicate with them in a non-blocking fashion. See the documentation for this Lua module for more details. This module was first introduced in lua-resty-core v0.1.16. ngx.processThis Lua module is used to manage the nginx process in Lua. See the documentation for this Lua module for more details. This module was first introduced in lua-resty-core v0.1.12. ngx.errlogThis Lua module provides Lua API to capture and manage nginx error log messages. See the documentation for this Lua module for more details. This module was first introduced in lua-resty-core v0.1.12. ngx.base64This Lua module provides Lua API to urlsafe base64 encode/decode. See the documentation for this Lua module for more details. This module was first introduced in lua-resty-core v0.1.14. CaveatIf the user Lua code is not JIT compiled, then use of this library may lead to performance drop in interpreted mode. You will only observe speedup when you get a good part of your user Lua code JIT compiled. TODO
AuthorYichun "agentzh" Zhang (章亦春) [email protected], OpenResty Inc. Copyright and LicenseThis module is licensed under the BSD license. Copyright (C) 2013-2019, by Yichun "agentzh" Zhang, OpenResty Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. See Also
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论