tmpl

package
v0.0.0-...-e964ed6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncMap = template.FuncMap{
	"select_fields":       GetSelectFields,
	"insert_fields":       GetInsertFields,
	"insert_values":       GetInsertValues,
	"insert_args":         GetInsertArgs,
	"scan_fields":         GetScanFields,
	"update_args":         GetUpdateArgs,
	"update_values":       GetUpdateValues,
	"upsert_fields":       GetUpsertFields,
	"upsert_values":       GetUpsertValues,
	"upsert_on_duplicate": GetUpsertOnDuplicate,
	"upsert_args":         GetUpsertArgs,
	"backtick":            Backtick,
}

Functions

func Backtick

func Backtick(s string) string

func GetInsertArgs

func GetInsertArgs(m StructTmplData) string

func GetInsertFields

func GetInsertFields(fields []TmplField) string

func GetInsertValues

func GetInsertValues(fields []TmplField) string

func GetScanFields

func GetScanFields(m StructTmplData) template.HTML

func GetSelectFields

func GetSelectFields(fields []TmplField) string

func GetUpdateArgs

func GetUpdateArgs(m StructTmplData) template.HTML

func GetUpdateValues

func GetUpdateValues(m StructTmplData) string

func GetUpsertArgs

func GetUpsertArgs(m StructTmplData) string

func GetUpsertFields

func GetUpsertFields(fields []TmplField) string

func GetUpsertOnDuplicate

func GetUpsertOnDuplicate(m StructTmplData) string

func GetUpsertValues

func GetUpsertValues(fields []TmplField) string

Types

type StructTmplData

type StructTmplData struct {
	Model       TmplStruct
	Receiver    string
	PackageName string
}

StructTmplData defines the top level struct data to pass to the models

type TmplField

type TmplField struct {
	Name       string
	Type       string
	ColumnName string
	Nullable   bool
}

TmplField defines a table field template

type TmplStruct

type TmplStruct struct {
	Name      string
	TableName string
	Fields    []TmplField
	Imports   map[string]struct{}
}

TmplStruct defines the table data to pass to the models

type TmplStructs

type TmplStructs []TmplStruct

TmplStructs is a collection on TmplStruct

Jump to

Keyboard shortcuts

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