2026-07-19 16:33:58 +00:00
|
|
|
package plugin
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2026-08-28 06:54:32 +02:00
|
|
|
"github.com/J3vb/OwnCord/Server/db"
|
2026-07-19 16:33:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// PluginStore manages installed plugins and per-plugin KV namespaces.
|
|
|
|
|
// *db.DB satisfies it (the methods moved into the db package when the store
|
|
|
|
|
// abstraction was removed in D3).
|
|
|
|
|
type PluginStore interface {
|
|
|
|
|
InstallPlugin(ctx context.Context, name, version, manifestJSON string) (int64, error)
|
|
|
|
|
EnablePlugin(ctx context.Context, id int64) error
|
|
|
|
|
DisablePlugin(ctx context.Context, id int64) error
|
|
|
|
|
UninstallPlugin(ctx context.Context, id int64) error
|
|
|
|
|
GetPlugin(ctx context.Context, id int64) (*db.PluginRow, error)
|
|
|
|
|
GetPluginByName(ctx context.Context, name string) (*db.PluginRow, error)
|
|
|
|
|
ListPlugins(ctx context.Context) ([]db.PluginRow, error)
|
|
|
|
|
|
|
|
|
|
PluginKVGet(ctx context.Context, pluginID int64, key string) ([]byte, error)
|
|
|
|
|
PluginKVSet(ctx context.Context, pluginID int64, key string, value []byte) error
|
|
|
|
|
PluginKVDelete(ctx context.Context, pluginID int64, key string) error
|
|
|
|
|
PluginKVScan(ctx context.Context, pluginID int64, prefix string, limit int) (map[string][]byte, error)
|
|
|
|
|
}
|