Documentation
¶
Overview ¶
Package capability defines the modular capability system. Each capability represents a feature (swagger, redis, otel, etc.) that declares its requirements, supported project types, and generation logic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability struct {
Name string
Description string
MinGo string // minimum Go version required (empty = no constraint)
ProjectTypes []string
Plan func(ctx Context) (*plan.Plan, error)
}
Capability represents a modular feature that Ginger can add to a project.
func (*Capability) CheckGoVersion ¶
func (c *Capability) CheckGoVersion(currentGo string) error
CheckGoVersion returns an error if the current Go version is below the capability's minimum requirement.
func (*Capability) SupportsProjectType ¶
func (c *Capability) SupportsProjectType(pt string) bool
SupportsProjectType returns true if the capability supports the given project type.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered capabilities.
func DefaultRegistry ¶
func DefaultRegistry() *Registry
DefaultRegistry returns the capabilities shipped with the CLI. Planning is delegated to the integration and generator packages to avoid package cycles.
func (*Registry) Available ¶
func (r *Registry) Available(projectType, goVersion string) []*Capability
Available returns capabilities that are available for the given project type and Go version.
func (*Registry) Blocked ¶
Blocked returns capabilities that are blocked for the given project type or Go version.
func (*Registry) Get ¶
func (r *Registry) Get(name string) (*Capability, bool)
Get returns a capability by name.
func (*Registry) Register ¶
func (r *Registry) Register(c *Capability)
Register adds a capability to the registry.