infra

package
v1.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package infra discovers the apps in a Forge project and generates Docker Compose, Kubernetes, DigitalOcean and Render deployment files for them.

Index

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) ExportDO

func (g *Generator) ExportDO(outputDir string) error

ExportDO exports Digital Ocean configuration to filesystem.

func (*Generator) ExportDocker

func (g *Generator) ExportDocker(outputDir string) error

ExportDocker exports Docker configuration to filesystem.

func (*Generator) ExportK8s

func (g *Generator) ExportK8s(outputDir string) error

ExportK8s exports Kubernetes manifests to filesystem.

func (*Generator) ExportRender

func (g *Generator) ExportRender(outputDir string) error

ExportRender exports Render configuration to filesystem.

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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL