util

package
v0.0.0-...-4a2c5d9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(dst interface{}, src interface{}) error

func FmtFieldName

func FmtFieldName(s string) string

fmtFieldName formats a string as a struct key

Example:

fmtFieldName("foo_id")

Output: FooID

Types

type ModelInfo

type ModelInfo struct {
	PackageName     string
	StructName      string
	ShortStructName string
	TableName       string
	Fields          []string
}

func GenerateStruct

func GenerateStruct(db *sql.DB, prefix, tableName, structName, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool) *ModelInfo

GenerateStruct generates a struct for the given table.

Jump to

Keyboard shortcuts

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