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-19 04:48:25 +09:00
|
|
|
|
# 将来の拡張例:
|
|
|
|
|
|
# "libnyash_database_plugin.so" = {
|
|
|
|
|
|
# boxes = ["PostgreSQLBox", "MySQLBox", "SQLiteBox"],
|
|
|
|
|
|
# path = "./target/release/libnyash_database_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]
|
2025-08-19 03:48:44 +09:00
|
|
|
|
# 全メソッドをmethod_idと共に定義
|
2025-08-19 04:48:25 +09:00
|
|
|
|
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-18 14:10:41 +09:00
|
|
|
|
|
2025-08-21 00:41:26 +09:00
|
|
|
|
# v2.1: Box引数を受け取るメソッド宣言(FileBox: copyFrom(other: Handle))
|
|
|
|
|
|
copyFrom = { method_id = 7, args = [ { kind = "box", category = "plugin" } ] }
|
|
|
|
|
|
|
|
|
|
|
|
# v2.2: BoxRef(Handle)を返すメソッド宣言
|
|
|
|
|
|
cloneSelf = { method_id = 8 }
|
|
|
|
|
|
|
2025-08-18 09:32:54 +09:00
|
|
|
|
[plugin_paths]
|
|
|
|
|
|
# プラグインの検索パス(デフォルト)
|
|
|
|
|
|
search_paths = [
|
2025-08-19 03:48:44 +09:00
|
|
|
|
"./target/release",
|
|
|
|
|
|
"./target/debug",
|
2025-08-18 09:32:54 +09:00
|
|
|
|
"./plugins/*/target/release",
|
|
|
|
|
|
"./plugins/*/target/debug",
|
|
|
|
|
|
"/usr/local/lib/nyash/plugins",
|
|
|
|
|
|
"~/.nyash/plugins"
|
2025-08-21 00:41:26 +09:00
|
|
|
|
]
|