generator

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine handles template parsing and execution with Sprig functions

func NewEngine

func NewEngine() (*Engine, error)

NewEngine creates a new template engine with Sprig functions

func (*Engine) Execute

func (e *Engine) Execute(templateName string, data interface{}) (string, error)

Execute executes a template with the given data

func (*Engine) ListTemplates

func (e *Engine) ListTemplates() []string

ListTemplates returns all available template names

type ProjectData

type ProjectData struct {
	Name         string // Project name (e.g., "my-api")
	Module       string // Go module name (e.g., "github.com/user/my-api")
	Template     string // Template type (standard, minimal, etc.)
	EchoNextPath string // Path to echonext for local development
}

ProjectData holds data for project template generation

type ProjectGenerator

type ProjectGenerator struct {
	// contains filtered or unexported fields
}

ProjectGenerator uses the template engine to generate project files

func NewProjectGenerator

func NewProjectGenerator(data *ProjectData) (*ProjectGenerator, error)

NewProjectGenerator creates a new project generator with template engine

func (*ProjectGenerator) GenerateAPIMain

func (g *ProjectGenerator) GenerateAPIMain() (string, error)

GenerateAPIMain generates the API main.go file content

func (*ProjectGenerator) GenerateAtlasConfig added in v1.3.0

func (g *ProjectGenerator) GenerateAtlasConfig() (string, error)

GenerateAtlasConfig generates the atlas.hcl file content

func (*ProjectGenerator) GenerateAtlasSum added in v1.3.0

func (g *ProjectGenerator) GenerateAtlasSum() (string, error)

GenerateAtlasSum generates the atlas.sum file content

func (*ProjectGenerator) GenerateCLIMain

func (g *ProjectGenerator) GenerateCLIMain() (string, error)

GenerateCLIMain generates the CLI main.go file content

func (*ProjectGenerator) GenerateConfig

func (g *ProjectGenerator) GenerateConfig() (string, error)

GenerateConfig generates the internal/config/config.go file content

func (*ProjectGenerator) GenerateDatabase

func (g *ProjectGenerator) GenerateDatabase() (string, error)

GenerateDatabase generates the internal/database/database.go file content

func (*ProjectGenerator) GenerateDevelopmentConfig

func (g *ProjectGenerator) GenerateDevelopmentConfig() (string, error)

GenerateDevelopmentConfig generates the development.yaml config file content

func (*ProjectGenerator) GenerateEnvExample added in v1.4.4

func (g *ProjectGenerator) GenerateEnvExample() (string, error)

GenerateEnvExample generates the .env.example file content

func (*ProjectGenerator) GenerateGoMod

func (g *ProjectGenerator) GenerateGoMod() (string, error)

GenerateGoMod generates the go.mod file content

func (*ProjectGenerator) GenerateInitialMigration added in v1.3.0

func (g *ProjectGenerator) GenerateInitialMigration() (string, error)

GenerateInitialMigration generates the initial SQL migration file content

func (*ProjectGenerator) GenerateMakefile

func (g *ProjectGenerator) GenerateMakefile() (string, error)

GenerateMakefile generates the Makefile content

func (*ProjectGenerator) GenerateMigrationMain

func (g *ProjectGenerator) GenerateMigrationMain() (string, error)

GenerateMigrationMain generates the migration main.go file content

func (*ProjectGenerator) GenerateOTEL

func (g *ProjectGenerator) GenerateOTEL() (string, error)

GenerateOTEL generates the internal/otel/otel.go file content

func (*ProjectGenerator) GenerateProductionConfig

func (g *ProjectGenerator) GenerateProductionConfig() (string, error)

GenerateProductionConfig generates the production.yaml config file content

func (*ProjectGenerator) GenerateReadme

func (g *ProjectGenerator) GenerateReadme() (string, error)

GenerateReadme generates the README.md file content

func (*ProjectGenerator) GenerateSchemaHCL added in v1.3.0

func (g *ProjectGenerator) GenerateSchemaHCL() (string, error)

GenerateSchemaHCL generates the schema.hcl file content

func (*ProjectGenerator) GenerateServer

func (g *ProjectGenerator) GenerateServer() (string, error)

GenerateServer generates the internal/server/server.go file content

func (*ProjectGenerator) GenerateTestConfig

func (g *ProjectGenerator) GenerateTestConfig() (string, error)

GenerateTestConfig generates the test.yaml config file content

func (*ProjectGenerator) GenerateUserModel

func (g *ProjectGenerator) GenerateUserModel() (string, error)

GenerateUserModel generates the user model file content

func (*ProjectGenerator) GenerateWorkerMain

func (g *ProjectGenerator) GenerateWorkerMain() (string, error)

GenerateWorkerMain generates the worker main.go file content

Jump to

Keyboard shortcuts

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