Documentation
¶
Overview ¶
v2/cmd/forge/plugins/infra/generator.go
v2/cmd/forge/plugins/infra/introspect.go
Index ¶
- type AppInfo
- type GeneratedConfig
- type Generator
- func (g *Generator) ExportDO(outputDir string) error
- func (g *Generator) ExportDocker(outputDir string) error
- func (g *Generator) ExportK8s(outputDir string) error
- func (g *Generator) ExportRender(outputDir string) error
- func (g *Generator) GenerateDOConfig(service, env, region string) (*GeneratedConfig, error)
- func (g *Generator) GenerateDockerCompose(service, env string) (*GeneratedConfig, error)
- func (g *Generator) GenerateK8sManifests(service, env string) (*GeneratedConfig, error)
- func (g *Generator) GenerateRenderConfig(service, env string) (*GeneratedConfig, error)
- type Introspector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppInfo ¶
type AppInfo struct {
Name string // Application name
Path string // Path to application directory
MainPath string // Path to main.go (relative to project root)
Module string // Go module path
Port int // Default port
HasDatabase bool // Whether app uses database
HasCache bool // Whether app uses cache
Dependencies []string // External dependencies
}
AppInfo represents information about a discovered application.
type GeneratedConfig ¶
type GeneratedConfig struct {
ServiceCount int
NetworkCount int
DeploymentCount int
VolumeCount int
}
GeneratedConfig represents the result of infrastructure generation.
type Generator ¶
type Generator struct {
Introspect *Introspector
// contains filtered or unexported fields
}
Generator handles infrastructure code generation.
func NewGenerator ¶
func NewGenerator(cfg *config.ForgeConfig) *Generator
NewGenerator creates a new infrastructure generator.
func (*Generator) ExportDocker ¶
ExportDocker exports Docker configuration to filesystem.
func (*Generator) ExportRender ¶
ExportRender exports Render configuration to filesystem.
func (*Generator) GenerateDOConfig ¶
func (g *Generator) GenerateDOConfig(service, env, region string) (*GeneratedConfig, error)
GenerateDOConfig generates Digital Ocean App Platform configuration in-memory.
func (*Generator) GenerateDockerCompose ¶
func (g *Generator) GenerateDockerCompose(service, env string) (*GeneratedConfig, error)
GenerateDockerCompose generates Docker Compose configuration in-memory.
func (*Generator) GenerateK8sManifests ¶
func (g *Generator) GenerateK8sManifests(service, env string) (*GeneratedConfig, error)
GenerateK8sManifests generates Kubernetes manifests in-memory.
func (*Generator) GenerateRenderConfig ¶
func (g *Generator) GenerateRenderConfig(service, env string) (*GeneratedConfig, error)
GenerateRenderConfig generates Render.com configuration in-memory.
type Introspector ¶
type Introspector struct {
// contains filtered or unexported fields
}
Introspector handles application discovery and introspection.
func NewIntrospector ¶
func NewIntrospector(cfg *config.ForgeConfig) *Introspector
NewIntrospector creates a new application introspector.
func (*Introspector) DiscoverApps ¶
func (i *Introspector) DiscoverApps() ([]AppInfo, error)
DiscoverApps discovers all applications in the project.
func (*Introspector) GetAppByName ¶
func (i *Introspector) GetAppByName(name string) (*AppInfo, error)
GetAppByName retrieves information about a specific app.