config

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentConfigVersion = 1

Variables

This section is empty.

Functions

func RenderVersionedTOML added in v1.2.0

func RenderVersionedTOML(cfg Config) string

RenderVersionedTOML renders a canonical ConfigVersion=1 TOML representation of the effective config. It is intended for migration and normalization, not for emitting the commented sample config.

func SampleTOML

func SampleTOML() string

Types

type Config

type Config struct {
	DatabaseDialect         DatabaseDialect
	OutPath                 string
	OutPackagePath          string
	ImportPackagePaths      []string
	Objects                 *[]string
	JSONTagOverridesByTable map[string]map[string]string
	ExtraFields             map[string][]ExtraField
	TypeMap                 map[string]string
	GeneratedTypes          GeneratedTypesConfig
	DbInit                  GenerateDbInitConfig
	NamingStrategy          schema.NamingStrategy `toml:"-"`
	CleanUp                 bool
	DbHost                  string
	DbPort                  int
	DbName                  string
	DbUser                  string
	DbPassword              string
	DbSSLMode               bool
	SQLiteDBPath            string
}

func Load

func Load(path string) (Config, error)

func (*Config) Normalize

func (c *Config) Normalize()

func (Config) Validate

func (c Config) Validate() error

type DatabaseDialect

type DatabaseDialect string
const (
	PostgreSQL DatabaseDialect = "postgresql"
	SQLite     DatabaseDialect = "sqlite"
)

type ExtraField

type ExtraField struct {
	StructPropName    string
	StructPropType    string
	FkStructPropName  string
	RefStructPropName string
	HasMany           bool
	Pointer           bool
}

type GenerateDbInitConfig

type GenerateDbInitConfig struct {
	Enabled                         bool
	IncludeAutoMigrate              bool
	GenerateAppSettingsRegistration bool
	UseSlogGormLogger               bool
}

type GeneratedTypesConfig

type GeneratedTypesConfig struct {
	PackageName  string
	RelativePath string
	PackagePath  string
	TypeMap      map[string]string
}

func (GeneratedTypesConfig) HasEntries

func (g GeneratedTypesConfig) HasEntries() bool

func (GeneratedTypesConfig) Validate

func (g GeneratedTypesConfig) Validate() error

Jump to

Keyboard shortcuts

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