db2entity

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Debug level logging

Functions

func ExecGoFmt

func ExecGoFmt(file string, dir string) error

func ExecWire

func ExecWire(dir string) error

func GenEntity

func GenEntity(v *viper.Viper) error

func GenInitFile

func GenInitFile(pkgName string, v *viper.Viper) string

func Generate

func Generate(columnTypes []columns, tableName string,
	structName string, pkgName string, jsonAnnotation bool,
	gormAnnotation bool, gureguTypes bool, v *viper.Viper) ([]byte, generateMysqlInfo, error)

Generate Given a Column map with datatypes and a name structName, attempts to generate a struct definition

func GenerateDao

func GenerateDao(tableName string, structName string, pkgName string,
	v *viper.Viper, genMysqlInfo generateMysqlInfo) ([]byte, error)

func GenerateRepo

func GenerateRepo(tableName string, structName string) string

func GetColumnsFromMysqlTable

func GetColumnsFromMysqlTable(mariadbUser string, mariadbPassword string,
	mariadbHost string, mariadbPort int, mariadbDatabase string,
	mariadbTable string) ([]columns, error)

GetColumnsFromMysqlTable Select column details from information schema and return map of map

func GetFirstToLower

func GetFirstToLower(str string) string

func GetFirstToUpper

func GetFirstToUpper(str string) string

func Inject

func Inject(structName string, fieldName, packageName, interName string,
	instName string, importStr string)

Types

type AutoTime

type AutoTime struct {
	CurTimeStamp      []string
	OnUpdateTimeStamp []string
}

type Field

type Field struct {
	Doc   []string
	Filed string
	Tag   string
}

func GetOldFields

func GetOldFields(GenDecl *ast.GenDecl, strSrc string) []Field

Jump to

Keyboard shortcuts

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