Documentation
¶
Overview ¶
Package model detects which plugin distribution model is in effect for a given plugin in the current project: Model A (Docker compose-managed, source under plugins-pro-src/) or Model B (single-binary, installed under ~/.nself/plugins/<name>/).
The detector is the foundation for any command that must apply a plugin operation correctly across both models — most importantly enable/disable, which must edit compose files for Model A but only flip the .disabled marker for Model B.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model int
Model identifies the distribution model of a plugin.
const ( // ModelUnknown means the plugin was not found by any detection step. ModelUnknown Model = iota // ModelB means the plugin is installed as a single binary in ~/.nself/plugins/<name>/. ModelB // ModelA means the plugin is compose-managed (source dir present, OR running compose service). ModelA // ModelMixed means both Model A and Model B artifacts were detected. // This is unexpected and the caller should surface a warning. ModelMixed )
func DetectModel ¶
DetectModel returns the distribution model for the named plugin in the current working project, using the environment-driven defaults. The result is informational: ModelUnknown is returned with a nil error when no artifacts are found.
Detection order (first match wins, but a Mixed result is returned when both A and B are detected):
- ~/.nself/plugins/<name>/ exists → ModelB
- <project>/plugins-pro-src/paid/<name>/ exists → ModelA
- docker compose ps shows service plugin-<name> → ModelA