Introductionâ
ManifestService provides plugins with read-only access to raw resource files under the manifest/ directory. Plugins access it via services.Manifest() to read plugin-owned files such as profile.yaml, config/config.example.yaml, i18n/zh-CN/plugin.json, and sql/*.sql.
This service is complementary to ConfigService: ConfigService reads plugin configuration values resolved through priority layers, while ManifestService reads the raw file content under manifest/.
Design Philosophyâ
The core design of ManifestService is raw resource reading. It offers three access modes:
Get: Reads raw byte content, suitable for resource files in any formatExists: Checks whether a resource exists, suitable for conditional logicScan: Deserializes aYAMLresource (or a nested key within it) into a target struct, suitable for structured configuration
Paths are slash-separated and relative to manifest/. For example:
| Path | Actual file | Description |
|---|---|---|
profile.yaml | manifest/profile.yaml | Plugin profile |
config/config.example.yaml | manifest/config/config.example.yaml | Configuration template |
i18n/zh-CN/plugin.json | manifest/i18n/zh-CN/plugin.json | Chinese language pack |
sql/install.sql | manifest/sql/install.sql | Installation script |
resources/policy.yaml | manifest/resources/policy.yaml | Policy configuration |
For source plugins, manifest/ resources are embedded into the compiled artifact via plugin_embed.go. ManifestService reads from the embedded filesystem. For dynamic plugins, resources are packaged with the .wasm artifact and bound to the current active release version at runtime.
Architectural Placementâ
ManifestService is used across multiple stages of the plugin lifecycle:
This service forms a complementary relationship with the following services:
ConfigService:ConfigServicereads configuration values resolved through priority layers;ManifestServicereads the raw configuration filesI18nService:I18nServiceperforms runtime translation;ManifestServicecan read the raw language pack files
Key Capabilitiesâ
| Method | Description |
|---|---|
Get | Reads raw byte content at a specified path under manifest/ |
Exists | Checks whether a resource exists at a specified path under manifest/ |
Scan | Deserializes a YAML resource (or a nested key within it) into a target struct |
Design Constraintsâ
- Paths are relative to
manifest/. Do not writemanifest/profile.yaml; useprofile.yamlinstead. - Only reads raw resources.
ManifestServiceis only responsible for reading file content, not for making resources "take effect." Reading a SQL script does not execute the installation; reading a language pack does not register translations. config.example.yamlis not used for default reading. It is a configuration template, not a runtime default.ConfigServicedefaults come frommanifest/config/config.yaml.- Plugins can only read their own resources. Similar to
ConfigService,ManifestServiceis plugin-scoped and cannot read themanifest/directory of other plugins.
Related Servicesâ
- ConfigService - Reads plugin configuration values resolved through priority layers
- I18nService - Runtime translation capability; language pack files are read through ManifestService