models

package
v0.0.0-...-96e820d Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeModels

func MakeModels(dir, model string)

func SQLType2Type

func SQLType2Type(st core.SQLType) reflect.Type

default sql type change to go types

Types

type LangTmpl

type LangTmpl struct {
	Funcs      template.FuncMap
	Formater   func(string) (string, error)
	GenImports func([]*core.Table) map[string]string
}
var (
	CPlusTmpl LangTmpl = LangTmpl{
		template.FuncMap{"Mapper": mapper.Table2Obj,
			"Type":    cPlusTypeStr,
			"UnTitle": unTitle,
		},
		nil,
		genCPlusImports,
	}
)
var (
	GoLangTmpl LangTmpl = LangTmpl{
		template.FuncMap{"Mapper": mapper.Table2Obj,
			"Type":    typestring,
			"Tag":     tag,
			"UnTitle": unTitle,
			"gt":      gt,
			"getCol":  getCol,
		},
		formatGo,
		genGoImports,
	}
)
var (
	ObjcTmpl LangTmpl = LangTmpl{
		template.FuncMap{"Mapper": mapper.Table2Obj,
			"Type":    objcTypeStr,
			"UnTitle": unTitle,
		},
		nil,
		genCPlusImports,
	}
)

type Tmpl

type Tmpl struct {
	Tables  []*core.Table
	Imports map[string]string
	Models  string
}

Jump to

Keyboard shortcuts

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