generator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(p Plugin)

Register adds a plugin to the registry.

Types

type AuthGenerator

type AuthGenerator struct {
	*BaseGenerator
}

func NewAuthGenerator

func NewAuthGenerator(writer *filesystem.Writer, renderer *template.Renderer) *AuthGenerator

func (*AuthGenerator) Generate

func (g *AuthGenerator) Generate(ctx *context.ProjectContext) error

func (*AuthGenerator) Name

func (g *AuthGenerator) Name() string

func (*AuthGenerator) Supports

func (g *AuthGenerator) Supports(projectType string) bool

type BaseGenerator

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

BaseGenerator provides common functionality for all generators.

func NewBaseGenerator

func NewBaseGenerator(writer *filesystem.Writer, renderer *template.Renderer) *BaseGenerator

NewBaseGenerator creates a new BaseGenerator instance.

func (*BaseGenerator) GenerateFromTemplates

func (b *BaseGenerator) GenerateFromTemplates(cfg *config.ProjectConfig, templates fs.FS, templateRoot string, targetSubPath string) error

GenerateFromTemplates walks through the templates and renders them.

func (*BaseGenerator) Tidy

func (b *BaseGenerator) Tidy(cfg *config.ProjectConfig) error

Tidy runs 'go mod tidy' in the project directory.

type CIGenerator

type CIGenerator struct {
	*BaseGenerator
}

func NewCIGenerator

func NewCIGenerator(writer *filesystem.Writer, renderer *template.Renderer) *CIGenerator

func (*CIGenerator) Generate

func (g *CIGenerator) Generate(ctx *context.ProjectContext) error

func (*CIGenerator) Name

func (g *CIGenerator) Name() string

func (*CIGenerator) Supports

func (g *CIGenerator) Supports(projectType string) bool

type CLIGenerator

type CLIGenerator struct {
	*BaseGenerator
}

func NewCLIGenerator

func NewCLIGenerator(writer *filesystem.Writer, renderer *template.Renderer) *CLIGenerator

func (*CLIGenerator) Generate

func (g *CLIGenerator) Generate(ctx *context.ProjectContext) error

func (*CLIGenerator) Name

func (g *CLIGenerator) Name() string

func (*CLIGenerator) Supports

func (g *CLIGenerator) Supports(projectType string) bool

type DBGenerator

type DBGenerator struct {
	*BaseGenerator
}

func NewDBGenerator

func NewDBGenerator(writer *filesystem.Writer, renderer *template.Renderer) *DBGenerator

func (*DBGenerator) Generate

func (g *DBGenerator) Generate(ctx *context.ProjectContext) error

func (*DBGenerator) Name

func (g *DBGenerator) Name() string

func (*DBGenerator) Supports

func (g *DBGenerator) Supports(projectType string) bool

type GRPCGenerator

type GRPCGenerator struct {
	*BaseGenerator
}

GRPCGenerator handles gRPC project generation.

func NewGRPCGenerator

func NewGRPCGenerator(writer *filesystem.Writer, renderer *template.Renderer) *GRPCGenerator

NewGRPCGenerator creates a new GRPCGenerator instance.

func (*GRPCGenerator) Generate

func (g *GRPCGenerator) Generate(ctx *context.ProjectContext) error

func (*GRPCGenerator) Name

func (g *GRPCGenerator) Name() string

func (*GRPCGenerator) Supports

func (g *GRPCGenerator) Supports(projectType string) bool

type GatewayGenerator

type GatewayGenerator struct {
	*BaseGenerator
}

func NewGatewayGenerator

func NewGatewayGenerator(writer *filesystem.Writer, renderer *template.Renderer) *GatewayGenerator

func (*GatewayGenerator) Generate

func (g *GatewayGenerator) Generate(ctx *context.ProjectContext) error

func (*GatewayGenerator) Name

func (g *GatewayGenerator) Name() string

func (*GatewayGenerator) Supports

func (g *GatewayGenerator) Supports(projectType string) bool

type Generator

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

Generator handles the project scaffolding.

func NewGenerator

func NewGenerator(out io.Writer, dryRun bool) *Generator

NewGenerator creates a new Generator instance.

func (*Generator) Generate

func (g *Generator) Generate(cfg *config.ProjectConfig) error

Generate scaffolds the project based on the configuration.

type K8sGenerator

type K8sGenerator struct {
	*BaseGenerator
}

func NewK8sGenerator

func NewK8sGenerator(writer *filesystem.Writer, renderer *template.Renderer) *K8sGenerator

func (*K8sGenerator) Generate

func (g *K8sGenerator) Generate(ctx *context.ProjectContext) error

func (*K8sGenerator) Name

func (g *K8sGenerator) Name() string

func (*K8sGenerator) Supports

func (g *K8sGenerator) Supports(projectType string) bool

type ObservabilityGenerator

type ObservabilityGenerator struct {
	*BaseGenerator
}

func NewObservabilityGenerator

func NewObservabilityGenerator(writer *filesystem.Writer, renderer *template.Renderer) *ObservabilityGenerator

func (*ObservabilityGenerator) Generate

func (*ObservabilityGenerator) Name

func (g *ObservabilityGenerator) Name() string

func (*ObservabilityGenerator) Supports

func (g *ObservabilityGenerator) Supports(projectType string) bool

type Plugin

type Plugin interface {
	Name() string
	Supports(projectType string) bool
	Generate(ctx *context.ProjectContext) error
}

Plugin defines the interface for a generator feature.

func Get

func Get(name string) (Plugin, error)

Get returns a plugin by name.

func List

func List() []Plugin

List returns all registered plugins.

type RESTGenerator

type RESTGenerator struct {
	*BaseGenerator
}

RESTGenerator handles REST project generation.

func NewRESTGenerator

func NewRESTGenerator(writer *filesystem.Writer, renderer *template.Renderer) *RESTGenerator

NewRESTGenerator creates a new RESTGenerator instance.

func (*RESTGenerator) Generate

func (g *RESTGenerator) Generate(ctx *context.ProjectContext) error

func (*RESTGenerator) Name

func (g *RESTGenerator) Name() string

func (*RESTGenerator) Supports

func (g *RESTGenerator) Supports(projectType string) bool

type TestGenerator

type TestGenerator struct {
	*BaseGenerator
}

func NewTestGenerator

func NewTestGenerator(writer *filesystem.Writer, renderer *template.Renderer) *TestGenerator

func (*TestGenerator) Generate

func (g *TestGenerator) Generate(ctx *context.ProjectContext) error

func (*TestGenerator) Name

func (g *TestGenerator) Name() string

func (*TestGenerator) Supports

func (g *TestGenerator) Supports(projectType string) bool

type WorkerGenerator

type WorkerGenerator struct {
	*BaseGenerator
}

func NewWorkerGenerator

func NewWorkerGenerator(writer *filesystem.Writer, renderer *template.Renderer) *WorkerGenerator

func (*WorkerGenerator) Generate

func (g *WorkerGenerator) Generate(ctx *context.ProjectContext) error

func (*WorkerGenerator) Name

func (g *WorkerGenerator) Name() string

func (*WorkerGenerator) Supports

func (g *WorkerGenerator) Supports(projectType string) bool

Jump to

Keyboard shortcuts

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