api

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnParam

type ColumnParam struct {
	ColumnName      string
	ColumnNameCamel string
	ColumnType      string
	IsNullable      bool
}

type Config

type Config struct {
	TargetSchema    string           `yaml:"targetSchema" json:"targetSchema"`
	TemplateConfigs []TemplateConfig `yaml:"templateConfigs" json:"templateConfigs"`
	DbConfig        DbConfig         `yaml:"dbConfig" json:"dbConfig"`
}

type DbConfig

type DbConfig struct {
	// Connection configuration
	Host     string `yaml:"host" json:"host"`
	Port     int    `yaml:"port" json:"port"`
	User     string `yaml:"user" json:"user"`
	Password string `yaml:"password" json:"password"`
	DbName   string `yaml:"dbName" json:"dbName"`
}

type Generator

type Generator struct {
	FuncMaps template.FuncMap
}

func NewGenerator

func NewGenerator(opts ...GeneratorOption) *Generator

func (*Generator) Generate

func (x *Generator) Generate(ctx context.Context, cfg Config) error

type GeneratorOption

type GeneratorOption func(*Generator)

func WithFuncMap

func WithFuncMap(funcMap template.FuncMap) GeneratorOption

type Param

type Param struct {
	TableParams []TableParam
}

type TableParam

type TableParam struct {
	TableName        string
	TableNameCamel   string
	TableNameCamelFU string
	Columns          []ColumnParam
}

type TemplateConfig

type TemplateConfig struct {
	TemplatePath string `yaml:"templatePath" json:"templatePath"`
	OutputPath   string `yaml:"outputPath" json:"outputPath"`
}

Jump to

Keyboard shortcuts

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