Some checks failed
CI / Build & Test (push) Failing after 1m31s
- Add user management endpoints (list/create/get/update/delete) with pagination and search - Add dashboard stats endpoint with tenant/user/online counts and growth metrics - Add tenant resolver middleware for multi-tenant request scoping - Add i18n kernel with zh/en message files and AcceptLanguage middleware - Add WebSocket hub/handler for real-time communication - Add job scheduler kernel with cron support - Add plugin sandbox for isolated execution - Add storage kernel (local filesystem) - Add event bus kernel for pub/sub - Add cache kernel abstraction - Add database migration runner and version upgrade checker - Add rate limiting middleware with Redis backend - Add SQL migrations for rbac, audit_logs, settings, notifications, examples - Extend user repository with list/delete/count operations - Register all module routes with tenant resolver
61 lines
2.0 KiB
Go
61 lines
2.0 KiB
Go
package plugin
|
|
|
|
// ManifestType represents the plugin category.
|
|
type ManifestType string
|
|
|
|
const (
|
|
TypeBackend ManifestType = "backend"
|
|
TypeFrontend ManifestType = "frontend"
|
|
TypeTheme ManifestType = "theme"
|
|
TypeHook ManifestType = "hook"
|
|
TypeMCP ManifestType = "mcp_tool"
|
|
)
|
|
|
|
// Manifest is the metadata contract for a .mengplugin package.
|
|
type Manifest struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Version string `json:"version"`
|
|
Description string `json:"description"`
|
|
Author Author `json:"author"`
|
|
Type ManifestType `json:"type"`
|
|
MinHostVersion string `json:"min_host_version"`
|
|
MaxHostVersion string `json:"max_host_version,omitempty"`
|
|
Permissions Permissions `json:"permissions"`
|
|
Dependencies []Dependency `json:"dependencies,omitempty"`
|
|
Entry Entry `json:"entry"`
|
|
Icon string `json:"icon,omitempty"`
|
|
Homepage string `json:"homepage,omitempty"`
|
|
License string `json:"license,omitempty"`
|
|
}
|
|
|
|
// Author identifies the plugin creator.
|
|
type Author struct {
|
|
Name string `json:"name"`
|
|
Email string `json:"email,omitempty"`
|
|
URL string `json:"url,omitempty"`
|
|
}
|
|
|
|
// Permissions declares what the plugin needs access to.
|
|
type Permissions struct {
|
|
Database []string `json:"database,omitempty"`
|
|
Storage bool `json:"storage,omitempty"`
|
|
Network []string `json:"network,omitempty"`
|
|
Events []string `json:"events,omitempty"`
|
|
Routes []string `json:"routes,omitempty"`
|
|
AdminPanel bool `json:"admin_panel,omitempty"`
|
|
}
|
|
|
|
// Dependency declares a required plugin or kernel module.
|
|
type Dependency struct {
|
|
ID string `json:"id"`
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
// Entry points to the plugin's executable and configuration.
|
|
type Entry struct {
|
|
Binary string `json:"binary"`
|
|
Config string `json:"config,omitempty"`
|
|
Migrate string `json:"migrate,omitempty"`
|
|
}
|