aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-07-24 21:25:17 +0200
committerKim Alvefur <zash@zash.se>2022-07-24 21:25:17 +0200
commit0ed1e69a4e78612fe27426f716ce8faa6042a24a (patch)
tree3d4b91fe5371263e75b98f6c45d61883738b2dfe
parentd459ec2f5dcf600840c44b75ff175c349b105bef (diff)
downloadprosody-0ed1e69a4e78612fe27426f716ce8faa6042a24a.tar.gz
prosody-0ed1e69a4e78612fe27426f716ce8faa6042a24a.zip
net.server: Add teal description file
-rw-r--r--teal-src/net/server.d.tl65
1 files changed, 65 insertions, 0 deletions
diff --git a/teal-src/net/server.d.tl b/teal-src/net/server.d.tl
new file mode 100644
index 00000000..bb61f677
--- /dev/null
+++ b/teal-src/net/server.d.tl
@@ -0,0 +1,65 @@
+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