golang

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFS embed.FS

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the golang init subcommand

func Run

func Run(opts Options) error

Run executes the golang init command

Types

type DomainInfo

type DomainInfo struct {
	Name      string
	NameCamel string
}

DomainInfo holds domain information for template generation

type MicroserviceConfig

type MicroserviceConfig struct {
	Name        string
	Port        int
	MetricsPort int
	Domains     []string
	Features    []string
}

MicroserviceConfig defines configuration for a microservice to generate

type Options

type Options struct {
	Name          string   // Project name
	Module        string   // Go module path
	Output        string   // Output directory
	Microservices []string // Microservices to generate
	Force         bool     // Overwrite existing files
	ProjectMS     string   // Custom name for the project microservice
	WithCLI       bool     // Generate CLI tool
}

Options holds all options for the golang init command

type TemplateData

type TemplateData struct {
	ProjectName         string
	ProjectMS           string
	ProjectNameSnake    string // snake_case version for CLI paths
	CLIName             string // CLI binary name (cli_<project_snake>)
	ServiceName         string
	ServiceNameCamel    string
	DomainName          string
	DomainNameCamel     string
	ModuleName          string
	RepositoryName      string
	RepositoryNameCamel string
	EntityName          string
	EntityNameCamel     string
	Domains             []DomainInfo
	Features            map[string]bool
	Port                int
	MetricsPort         int
	Timestamp           string
	MigrationTimestamp  string

	// Database configuration
	DatabaseHost                  string
	DatabasePort                  int
	DatabaseName                  string
	DatabaseUsername              string
	DatabasePassword              string
	DatabaseSSLMode               string
	DatabaseMaxOpenConnections    int
	DatabaseMaxIdleConnections    int
	DatabaseConnectionMaxLifetime string

	// Redis configuration
	RedisHost     string
	RedisPort     int
	RedisPassword string
	RedisDatabase int

	// Security configuration
	JWTSecretKey string
	AdminAPIKey  string
}

TemplateData holds the data passed to templates

Jump to

Keyboard shortcuts

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