add plugins
All checks were successful
Build Multi-Platform Binaries / build (push) Successful in 11m9s
All checks were successful
Build Multi-Platform Binaries / build (push) Successful in 11m9s
This commit is contained in:
29
pkg/plugin/store/interface.go
Normal file
29
pkg/plugin/store/interface.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"github.com/gotunnel/pkg/plugin"
|
||||
)
|
||||
|
||||
// PluginStore 管理 plugin 持久化
|
||||
type PluginStore interface {
|
||||
// GetAllPlugins 返回所有存储的 plugins
|
||||
GetAllPlugins() ([]plugin.PluginMetadata, error)
|
||||
|
||||
// GetPlugin 返回指定 plugin 的元数据
|
||||
GetPlugin(name string) (*plugin.PluginMetadata, error)
|
||||
|
||||
// GetPluginData 返回 WASM 二进制
|
||||
GetPluginData(name string) ([]byte, error)
|
||||
|
||||
// SavePlugin 存储 plugin
|
||||
SavePlugin(metadata plugin.PluginMetadata, wasmData []byte) error
|
||||
|
||||
// DeletePlugin 删除 plugin
|
||||
DeletePlugin(name string) error
|
||||
|
||||
// PluginExists 检查 plugin 是否存在
|
||||
PluginExists(name string) (bool, error)
|
||||
|
||||
// Close 关闭存储
|
||||
Close() error
|
||||
}
|
||||
Reference in New Issue
Block a user