diff options
author | Kim Alvefur <zash@zash.se> | 2023-03-23 13:36:52 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-03-23 13:36:52 +0100 |
commit | f68336b96e0d843511bb1bd3fdac8bba2fe4573a (patch) | |
tree | a54111914e081293e50b846e7f0d9654e885c2ed /teal-src/net | |
parent | 738df041ac3965496e9247acc95d80f84d30b2b5 (diff) | |
download | prosody-f68336b96e0d843511bb1bd3fdac8bba2fe4573a.tar.gz prosody-f68336b96e0d843511bb1bd3fdac8bba2fe4573a.zip |
teal: Move into prosody namespace
Diffstat (limited to 'teal-src/net')
-rw-r--r-- | teal-src/net/http.d.tl | 86 | ||||
-rw-r--r-- | teal-src/net/http/codes.d.tl | 2 | ||||
-rw-r--r-- | teal-src/net/http/errors.d.tl | 22 | ||||
-rw-r--r-- | teal-src/net/http/files.d.tl | 14 | ||||
-rw-r--r-- | teal-src/net/http/parser.d.tl | 58 | ||||
-rw-r--r-- | teal-src/net/http/server.d.tl | 6 | ||||
-rw-r--r-- | teal-src/net/server.d.tl | 65 |
7 files changed, 0 insertions, 253 deletions
diff --git a/teal-src/net/http.d.tl b/teal-src/net/http.d.tl deleted file mode 100644 index 9135ec12..00000000 --- a/teal-src/net/http.d.tl +++ /dev/null @@ -1,86 +0,0 @@ -local Promise = require "util.promise".Promise; - -local record sslctx -- from LuaSec -end - -local record lib - - enum http_method - "GET" - "HEAD" - "POST" - "PUT" - "OPTIONS" - "DELETE" - -- etc? - end - - record http_client_options - sslctx : sslctx - end - - record http_options - id : string - onlystatus : boolean - body : string - method : http_method - headers : { string : string } - insecure : boolean - suppress_errors : boolean - streaming_handler : function - suppress_url : boolean - sslctx : sslctx - end - - record http_request - host : string - port : string - enum scheme - "http" - "https" - end - scheme : scheme - url : string - userinfo : string - path : string - - method : http_method - headers : { string : string } - - insecure : boolean - suppress_errors : boolean - streaming_handler : function - http : http_client - time : integer - id : string - callback : http_callback - end - - record http_response - end - - type http_callback = function (string, number, http_response, http_request) - - record http_client - options : http_client_options - request : function (http_client, string, http_options, http_callback) - end - - request : function (string, http_options, http_callback) : Promise, string - default : http_client - new : function (http_client_options) : http_client - events : table - -- COMPAT - urlencode : function (string) : string - urldecode : function (string) : string - formencode : function ({ string : string }) : string - formdecode : function (string) : { string : string } - destroy_request : function (http_request) - - enum available_features - "sni" - end - features : { available_features : boolean } -end - -return lib diff --git a/teal-src/net/http/codes.d.tl b/teal-src/net/http/codes.d.tl deleted file mode 100644 index 65d004fc..00000000 --- a/teal-src/net/http/codes.d.tl +++ /dev/null @@ -1,2 +0,0 @@ -local type response_codes = { integer : string } -return response_codes diff --git a/teal-src/net/http/errors.d.tl b/teal-src/net/http/errors.d.tl deleted file mode 100644 index a9b6ea6c..00000000 --- a/teal-src/net/http/errors.d.tl +++ /dev/null @@ -1,22 +0,0 @@ -local record http_errors - enum known_conditions - "cancelled" - "connection-closed" - "certificate-chain-invalid" - "certificate-verify-failed" - "connection failed" - "invalid-url" - "unable to resolve service" - end - type registry_keys = known_conditions | integer - record error - type : string - condition : string - code : integer - text : string - end - registry : { registry_keys : error } - new : function (integer, known_conditions, table) - new : function (integer, string, table) -end -return http_errors diff --git a/teal-src/net/http/files.d.tl b/teal-src/net/http/files.d.tl deleted file mode 100644 index d0ba5c1c..00000000 --- a/teal-src/net/http/files.d.tl +++ /dev/null @@ -1,14 +0,0 @@ -local record serve_options - path : string - mime_map : { string : string } - cache_size : integer - cache_max_file_size : integer - index_files : { string } - directory_index : boolean -end - -local record http_files - serve : function(serve_options|string) : function -end - -return http_files diff --git a/teal-src/net/http/parser.d.tl b/teal-src/net/http/parser.d.tl deleted file mode 100644 index 1cd6ccf4..00000000 --- a/teal-src/net/http/parser.d.tl +++ /dev/null @@ -1,58 +0,0 @@ -local record httpstream - feed : function(httpstream, string) -end - -local type sink_cb = function () - -local record httppacket - enum http_method - "HEAD" - "GET" - "POST" - "PUT" - "DELETE" - "OPTIONS" - -- etc - end - method : http_method - record url_details - path : string - query : string - end - url : url_details - path : string - enum http_version - "1.0" - "1.1" - end - httpversion : http_version - headers : { string : string } - body : string | boolean - body_sink : sink_cb - chunked : boolean - partial : boolean -end - -local enum error_conditions - "cancelled" - "connection-closed" - "certificate-chain-invalid" - "certificate-verify-failed" - "connection failed" - "invalid-url" - "unable to resolve service" -end - -local type success_cb = function (httppacket) -local type error_cb = function (error_conditions) - -local enum stream_mode - "client" - "server" -end - -local record lib - new : function (success_cb, error_cb, stream_mode) : httpstream -end - -return lib diff --git a/teal-src/net/http/server.d.tl b/teal-src/net/http/server.d.tl deleted file mode 100644 index 5a83af7e..00000000 --- a/teal-src/net/http/server.d.tl +++ /dev/null @@ -1,6 +0,0 @@ - -local record http_server - -- TODO -end - -return http_server diff --git a/teal-src/net/server.d.tl b/teal-src/net/server.d.tl deleted file mode 100644 index bb61f677..00000000 --- a/teal-src/net/server.d.tl +++ /dev/null @@ -1,65 +0,0 @@ -local record server - record LuaSocketTCP - end - record LuaSecCTX - end - - record extra_settings - end - - record interface - end - enum socket_type - "tcp" - "tcp6" - "tcp4" - end - - record listeners - onconnect : function (interface) - ondetach : function (interface) - onattach : function (interface, string) - onincoming : function (interface, string, string) - ondrain : function (interface) - onreadtimeout : function (interface) - onstarttls : function (interface) - onstatus : function (interface, string) - ondisconnect : function (interface, string) - end - - get_backend : function () : string - - type port = string | integer - enum read_mode - "*a" - "*l" - end - type read_size = read_mode | integer - addserver : function (string, port, listeners, read_size, LuaSecCTX) : interface - addclient : function (string, port, listeners, read_size, LuaSecCTX, socket_type, extra_settings) : interface - record listen_config - read_size : read_size - tls_ctx : LuaSecCTX - tls_direct : boolean - sni_hosts : { string : LuaSecCTX } - end - listen : function (string, port, listeners, listen_config) : interface - enum quitting - "quitting" - end - loop : function () : quitting - closeall : function () - setquitting : function (boolean | quitting) - - wrapclient : function (LuaSocketTCP, string, port, listeners, read_size, LuaSecCTX, extra_settings) : interface - wrapserver : function (LuaSocketTCP, string, port, listeners, listen_config) : interface - watchfd : function (integer | LuaSocketTCP, function (interface), function (interface)) : interface - link : function () - - record config - end - set_config : function (config) - -end - -return server |