generator

package
v0.0.0-...-15b3647 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	TableName  string
	OriginName string
	ConstName  string
	GoName     string
	GoType     string
	IsNullable bool
}

type Generator

type Generator struct {
	PackageName      string
	ProjectDirectory string
	ModelDirectory   string
}

func New

func New(packageName, projectDirectory, modelDirectory string) (*Generator, error)

func (*Generator) CopyColumnWithoutID

func (g *Generator) CopyColumnWithoutID(columns []Column) []Column

func (*Generator) Generate

func (g *Generator) Generate(m models.Create) error

func (*Generator) GenerateModels

func (g *Generator) GenerateModels(r Repository) error

func (*Generator) GenerateRepository

func (g *Generator) GenerateRepository(r Repository) error

func (*Generator) LoadGo

func (g *Generator) LoadGo(patterns ...string) error

LoadGo deprecated

func (*Generator) ToGoType

func (g *Generator) ToGoType(sqlType string) (string, error)

type Params

type Params struct {
	OriginName string
	GoName     string
	Columns    []Column
}

type Repository

type Repository struct {
	PackageName    string
	ConstName      string
	ModelDirectory string
	ModelType      string
	OriginName     string
	GoName         string
	ID             Column
	CreatedAt      *Column
	UpdatedAt      *Column

	Columns []Column
}

Jump to

Keyboard shortcuts

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