Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Capabilities struct {
HTTP []string `toml:"http"`
Database []string `toml:"database"`
RateLimit RateLimitConfig `toml:"rate_limit"`
}
Capabilities defines what a plugin is allowed to do. Mirrors the [capabilities] TOML section in a manifest file.
type Manifest ¶
type Manifest struct {
Name string `toml:"name"`
Version string `toml:"version"`
MaxMemoryMB int `toml:"max_memory_mb"`
Capabilities Capabilities `toml:"capabilities"`
}
Manifest represents a plugin's capability declaration. Placed alongside the .wasm file as <name>.manifest.
func LoadManifest ¶
LoadManifest reads a TOML capability manifest from the given path. Returns nil, nil if the file does not exist (missing manifest = no capabilities).
func (Manifest) HasDBPermission ¶
HasDBPermission checks whether the manifest allows a specific db permission.
func (Manifest) HasDatabase ¶
HasDatabase reports whether the manifest declares any database permissions.
func (Manifest) IsHTTPURLAllowed ¶
IsHTTPURLAllowed checks whether url is covered by any declared HTTP pattern. Uses simple prefix matching.
type RateLimitConfig ¶
type RateLimitConfig struct {
RequestsPerMinute int `toml:"requests_per_minute"`
}
RateLimitConfig controls how often a plugin can call host functions.