generator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageNameFromProject

func PackageNameFromProject(projectName string) string

func ValidateDatabaseName

func ValidateDatabaseName(name string) error

func ValidateHTTPPort

func ValidateHTTPPort(port int) error

func ValidateModulePath

func ValidateModulePath(module string) error

func ValidateProjectName

func ValidateProjectName(name string) error

func ValidateTargetDir

func ValidateTargetDir(path string) error

Types

type Generator

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

Generator scaffolds projects from embedded templates.

func New

func New() (*Generator, error)

New creates a Generator with embedded API templates.

func (*Generator) Init

func (g *Generator) Init(opts InitOptions) ([]engine.PlanEntry, error)

Init creates a new project at opts.TargetDir.

func (*Generator) PostProcessProject

func (g *Generator) PostProcessProject(dir string) error

PostProcessProject formats Go sources and runs the test suite for the generated project.

type InitOptions

type InitOptions struct {
	ProjectName  string
	ModulePath   string
	HTTPPort     int
	DatabaseName string
	TargetDir    string
	Author       string
	DryRun       bool
}

InitOptions holds parameters for project scaffolding.

type TemplateData

type TemplateData = template.Data

TemplateData is passed to text/template when rendering files.

Jump to

Keyboard shortcuts

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