Documentation
¶
Index ¶
- Variables
- func ValidateArchitecture(architecture string) error
- func ValidateAuthType(authType string) error
- func ValidateAuthor(author string) error
- func ValidateDatabaseDriver(driver string) error
- func ValidateEmail(email string) error
- func ValidateFeatures(features map[string]interface{}) error
- func ValidateFramework(framework string) error
- func ValidateGoVersion(version string) error
- func ValidateLogFormat(format string) error
- func ValidateLogLevel(level string) error
- func ValidateLogger(logger string) error
- func ValidateModulePath(path string) error
- func ValidateORM(orm string) error
- func ValidateOutputPath(path string) error
- func ValidateProjectName(name string) error
- func ValidateTemplateType(templateType string) error
- type AuthDefaults
- type Config
- type DatabaseDefaults
- type LoggingDefaults
- type Profile
- type ProfileDefaults
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultConfig is the default configuration DefaultConfig = Config{ Profiles: map[string]Profile{ "default": { Author: "", Email: "", License: "MIT", Defaults: ProfileDefaults{ GoVersion: "1.21", Framework: "gin", Architecture: "standard", Logger: "slog", Database: DatabaseDefaults{ Driver: "", ORM: "gorm", }, Auth: AuthDefaults{ Type: "", }, Logging: LoggingDefaults{ Type: "slog", Level: "info", Format: "json", Structured: true, }, }, }, }, CurrentProfile: "default", } )
Functions ¶
func ValidateArchitecture ¶
ValidateArchitecture validates an architecture pattern
func ValidateAuthType ¶
ValidateAuthType validates an authentication type
func ValidateAuthor ¶
ValidateAuthor validates an author name
func ValidateDatabaseDriver ¶
ValidateDatabaseDriver validates a database driver
func ValidateEmail ¶
ValidateEmail validates an email address
func ValidateFeatures ¶
ValidateFeatures validates project features configuration
func ValidateFramework ¶
ValidateFramework validates a framework choice
func ValidateGoVersion ¶
ValidateGoVersion validates a Go version string
func ValidateLogFormat ¶
ValidateLogFormat validates a log format
func ValidateLogLevel ¶
ValidateLogLevel validates a log level
func ValidateLogger ¶
ValidateLogger validates a logger type
func ValidateModulePath ¶
ValidateModulePath validates a Go module path
func ValidateOutputPath ¶
ValidateOutputPath validates an output directory path
func ValidateProjectName ¶
ValidateProjectName validates a project name
func ValidateTemplateType ¶
ValidateTemplateType validates a template type
Types ¶
type AuthDefaults ¶
type AuthDefaults struct { // Type is the default authentication type Type string `yaml:"type" mapstructure:"type"` }
AuthDefaults contains default authentication configuration
type Config ¶
type Config struct { // Profiles contain user configuration profiles Profiles map[string]Profile `yaml:"profiles" mapstructure:"profiles"` // CurrentProfile is the active profile name CurrentProfile string `yaml:"current_profile" mapstructure:"current_profile"` }
Config represents the application configuration
func (*Config) AddProfile ¶
AddProfile adds a new profile to the configuration
func (*Config) GetCurrentProfile ¶
GetCurrentProfile returns the current active profile
func (*Config) RemoveProfile ¶
RemoveProfile removes a profile from the configuration
func (*Config) SetCurrentProfile ¶
SetCurrentProfile sets the current active profile
type DatabaseDefaults ¶
type DatabaseDefaults struct { // Driver is the default database driver Driver string `yaml:"driver" mapstructure:"driver"` // ORM is the default ORM ORM string `yaml:"orm" mapstructure:"orm"` }
DatabaseDefaults contains default database configuration
type LoggingDefaults ¶
type LoggingDefaults struct { // Type is the default logger type Type string `yaml:"type" mapstructure:"type"` // Level is the default log level Level string `yaml:"level" mapstructure:"level"` // Format is the default log format Format string `yaml:"format" mapstructure:"format"` // Structured indicates if structured logging is enabled by default Structured bool `yaml:"structured" mapstructure:"structured"` }
LoggingDefaults contains default logging configuration
type Profile ¶
type Profile struct { // Author is the default project author Author string `yaml:"author" mapstructure:"author"` // Email is the default author email Email string `yaml:"email" mapstructure:"email"` // License is the default license type License string `yaml:"license" mapstructure:"license"` // Defaults contains default values for project generation Defaults ProfileDefaults `yaml:"defaults" mapstructure:"defaults"` }
Profile represents a user configuration profile
type ProfileDefaults ¶
type ProfileDefaults struct { // GoVersion is the default Go version to use GoVersion string `yaml:"go_version" mapstructure:"go_version"` // Framework is the default framework Framework string `yaml:"framework" mapstructure:"framework"` // Architecture is the default architecture pattern Architecture string `yaml:"architecture" mapstructure:"architecture"` // Logger is the default logger type Logger string `yaml:"logger" mapstructure:"logger"` // Database is the default database configuration Database DatabaseDefaults `yaml:"database" mapstructure:"database"` // Auth is the default authentication configuration Auth AuthDefaults `yaml:"auth" mapstructure:"auth"` // Logging is the default logging configuration Logging LoggingDefaults `yaml:"logging" mapstructure:"logging"` }
ProfileDefaults contains default values for project generation