2025-08-19 04:48:25 +09:00
|
|
|
|
# Nyash Configuration File v2
|
|
|
|
|
|
# マルチBox型プラグイン対応
|
2025-08-18 09:32:54 +09:00
|
|
|
|
|
2025-08-19 04:48:25 +09:00
|
|
|
|
[libraries]
|
|
|
|
|
|
# ライブラリ定義(1つのプラグインで複数のBox型を提供可能)
|
|
|
|
|
|
[libraries."libnyash_filebox_plugin.so"]
|
|
|
|
|
|
boxes = ["FileBox"]
|
|
|
|
|
|
path = "./plugins/nyash-filebox-plugin/target/release/libnyash_filebox_plugin.so"
|
2025-08-18 09:32:54 +09:00
|
|
|
|
|
2025-08-21 16:46:07 +09:00
|
|
|
|
[libraries."libnyash_counter_plugin.so"]
|
|
|
|
|
|
boxes = ["CounterBox"]
|
|
|
|
|
|
path = "./plugins/nyash-counter-plugin/target/release/libnyash_counter_plugin.so"
|
|
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so"]
|
|
|
|
|
|
boxes = ["HttpServerBox", "HttpClientBox", "HttpResponseBox", "HttpRequestBox", "SocketServerBox", "SocketClientBox", "SocketConnBox"]
|
|
|
|
|
|
path = "./plugins/nyash-net-plugin/target/release/libnyash_net_plugin.so"
|
2025-08-18 09:32:54 +09:00
|
|
|
|
|
2025-08-19 04:48:25 +09:00
|
|
|
|
# FileBoxの型情報定義
|
|
|
|
|
|
[libraries."libnyash_filebox_plugin.so".FileBox]
|
2025-08-19 03:48:44 +09:00
|
|
|
|
type_id = 6
|
2025-08-18 14:10:41 +09:00
|
|
|
|
|
2025-08-19 04:48:25 +09:00
|
|
|
|
[libraries."libnyash_filebox_plugin.so".FileBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
2025-08-19 03:48:44 +09:00
|
|
|
|
open = { method_id = 1, args = ["path", "mode"] }
|
2025-08-19 04:48:25 +09:00
|
|
|
|
read = { method_id = 2 }
|
2025-08-19 03:48:44 +09:00
|
|
|
|
write = { method_id = 3, args = ["data"] }
|
2025-08-19 04:48:25 +09:00
|
|
|
|
close = { method_id = 4 }
|
|
|
|
|
|
fini = { method_id = 4294967295 }
|
2025-08-21 00:41:26 +09:00
|
|
|
|
copyFrom = { method_id = 7, args = [ { kind = "box", category = "plugin" } ] }
|
|
|
|
|
|
cloneSelf = { method_id = 8 }
|
|
|
|
|
|
|
2025-08-21 16:46:07 +09:00
|
|
|
|
[libraries."libnyash_counter_plugin.so".CounterBox]
|
|
|
|
|
|
type_id = 7
|
2025-08-21 21:35:17 +09:00
|
|
|
|
singleton = true
|
2025-08-21 16:46:07 +09:00
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_counter_plugin.so".CounterBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
|
|
|
|
|
inc = { method_id = 1 }
|
|
|
|
|
|
get = { method_id = 2 }
|
|
|
|
|
|
fini = { method_id = 4294967295 }
|
|
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
# HttpServerBox
|
2025-08-21 22:25:42 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpServerBox]
|
|
|
|
|
|
type_id = 20
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpServerBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
2025-08-22 06:21:01 +09:00
|
|
|
|
start = { method_id = 1, args = ["port"], returns_result = true }
|
|
|
|
|
|
stop = { method_id = 2, returns_result = true }
|
|
|
|
|
|
accept = { method_id = 3, returns_result = true }
|
2025-08-21 22:25:42 +09:00
|
|
|
|
fini = { method_id = 4294967295 }
|
|
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
# HttpClientBox
|
|
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpClientBox]
|
|
|
|
|
|
type_id = 23
|
2025-08-21 22:25:42 +09:00
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpClientBox.methods]
|
2025-08-21 22:25:42 +09:00
|
|
|
|
birth = { method_id = 0 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
get = { method_id = 1, args = ["url"], returns_result = true }
|
|
|
|
|
|
post = { method_id = 2, args = ["url", "body"], returns_result = true }
|
2025-08-21 22:25:42 +09:00
|
|
|
|
fini = { method_id = 4294967295 }
|
|
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
# HttpResponseBox
|
2025-08-21 22:25:42 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpResponseBox]
|
|
|
|
|
|
type_id = 22
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpResponseBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
setStatus = { method_id = 1, args = ["status"] }
|
|
|
|
|
|
setHeader = { method_id = 2, args = ["key", "value"] }
|
|
|
|
|
|
write = { method_id = 3, args = ["body"] }
|
2025-08-21 22:25:42 +09:00
|
|
|
|
readBody = { method_id = 4 }
|
2025-08-21 23:11:31 +09:00
|
|
|
|
getStatus = { method_id = 5 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
getHeader = { method_id = 6, args = ["key"] }
|
2025-08-21 22:25:42 +09:00
|
|
|
|
fini = { method_id = 4294967295 }
|
|
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
# HttpRequestBox
|
|
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpRequestBox]
|
|
|
|
|
|
type_id = 21
|
2025-08-21 22:25:42 +09:00
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so".HttpRequestBox.methods]
|
2025-08-21 22:25:42 +09:00
|
|
|
|
birth = { method_id = 0 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
path = { method_id = 1 }
|
|
|
|
|
|
readBody = { method_id = 2 }
|
|
|
|
|
|
respond = { method_id = 3, args = [{ kind = "box", category = "plugin" }] }
|
2025-08-21 22:25:42 +09:00
|
|
|
|
fini = { method_id = 4294967295 }
|
2025-08-22 02:54:50 +09:00
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
# SocketServerBox
|
2025-08-22 02:54:50 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so".SocketServerBox]
|
|
|
|
|
|
type_id = 30
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_net_plugin.so".SocketServerBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
bind = { method_id = 1, args = ["port"] }
|
|
|
|
|
|
accept = { method_id = 2 }
|
2025-08-22 02:54:50 +09:00
|
|
|
|
fini = { method_id = 4294967295 }
|
|
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
# SocketClientBox
|
2025-08-22 02:54:50 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so".SocketClientBox]
|
|
|
|
|
|
type_id = 32
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_net_plugin.so".SocketClientBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
connect = { method_id = 1, args = ["host", "port"] }
|
|
|
|
|
|
send = { method_id = 2, args = ["data"] }
|
|
|
|
|
|
receive = { method_id = 3 }
|
|
|
|
|
|
close = { method_id = 4 }
|
2025-08-22 02:54:50 +09:00
|
|
|
|
fini = { method_id = 4294967295 }
|
|
|
|
|
|
|
2025-08-22 12:09:06 +09:00
|
|
|
|
# SocketConnBox
|
2025-08-22 02:54:50 +09:00
|
|
|
|
[libraries."libnyash_net_plugin.so".SocketConnBox]
|
|
|
|
|
|
type_id = 31
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_net_plugin.so".SocketConnBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
send = { method_id = 1, args = ["data"] }
|
2025-08-22 02:54:50 +09:00
|
|
|
|
recv = { method_id = 2 }
|
|
|
|
|
|
close = { method_id = 3 }
|
|
|
|
|
|
fini = { method_id = 4294967295 }
|
2025-08-22 12:09:06 +09:00
|
|
|
|
|
|
|
|
|
|
[plugin_paths]
|
|
|
|
|
|
# プラグインの検索パス(デフォルト)
|
|
|
|
|
|
search_paths = [
|
|
|
|
|
|
"./target/release",
|
|
|
|
|
|
"./target/debug",
|
|
|
|
|
|
"./plugins/*/target/release",
|
|
|
|
|
|
"./plugins/*/target/debug",
|
|
|
|
|
|
"/usr/local/lib/nyash/plugins",
|
|
|
|
|
|
"~/.nyash/plugins"
|
|
|
|
|
|
]
|
2025-08-29 04:37:30 +09:00
|
|
|
|
[libraries."libnyash_array_plugin.so"]
|
|
|
|
|
|
boxes = ["ArrayBox"]
|
|
|
|
|
|
path = "./plugins/nyash-array-plugin/target/release/libnyash_array_plugin.so"
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_array_plugin.so".ArrayBox]
|
|
|
|
|
|
type_id = 10
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_array_plugin.so".ArrayBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
|
|
|
|
|
length = { method_id = 1 }
|
|
|
|
|
|
get = { method_id = 2, args = ["index"] }
|
|
|
|
|
|
push = { method_id = 3, args = ["value"] }
|
|
|
|
|
|
set = { method_id = 4, args = ["index", "value"] }
|
|
|
|
|
|
fini = { method_id = 4294967295 }
|
|
|
|
|
|
[libraries."libnyash_map_plugin.so"]
|
|
|
|
|
|
boxes = ["MapBox"]
|
|
|
|
|
|
path = "./plugins/nyash-map-plugin/target/release/libnyash_map_plugin.so"
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_map_plugin.so".MapBox]
|
|
|
|
|
|
type_id = 11
|
|
|
|
|
|
|
|
|
|
|
|
[libraries."libnyash_map_plugin.so".MapBox.methods]
|
|
|
|
|
|
birth = { method_id = 0 }
|
|
|
|
|
|
size = { method_id = 1 }
|
|
|
|
|
|
get = { method_id = 2, args = ["key"] }
|
|
|
|
|
|
has = { method_id = 3, args = ["key"] }
|
|
|
|
|
|
fini = { method_id = 4294967295 }
|