task

package
v0.0.0-...-6d6c219 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET_DELETE_INT = `if %s.%s < 1 {
		return ae.MissingParamError("%s")
	}`

	GET_DELETE_STRING = `if %s.%s == "" {
		return ae.MissingParamError("%s")
	}`

	POST_STRING = `if %s.%s == "" {
		return ae.MissingParamError("%s")
	}`
	POST_NULL = `if !%s.%s.Valid {
		return ae.MissingParamError("%s")
	}`
	POST_NULL_LEN = `if %s.%s.Valid && len(%s.%s.ValueOrZero()) > %d {
		return ae.StringLengthError("%s", %d)
	}`
	POST_STRING_LEN = `if len(%s.%s) > %d {
		return ae.StringLengthError("%s", %d)
	}`
	// Abbr, columnCamel, ColumnCamel, Abbr, ColumnCamel, ColumnCamel
	POST_JSON_NULL = `` /* 142-byte string literal not displayed */

	PATCH_STRING_ASSIGN = `// %s
	if %sIn.%s != "" {
		%s.%s = %sIn.%s
	}`
	PATCH_DEFAULT_ASSIGN = `// %s
	if %sIn.%s.Valid {%s
		existingValues["%s"] = %s.%s%s
		%s.%s = %sIn.%s
	}`
	PATCH_JSON_NULL_ASSIGN = `` /* 169-byte string literal not displayed */

	PATCH_TIME_NULL_ASSIGN = `// %s
	if %sIn.%s.Valid {
		existingValues["%s"] = %s.%s.Time.Format(time.RFC3339)
		%s.%s = %sIn.%s
	}`
	PATCH_VARCHAR_LEN = `
		if %sIn.%s.Valid && len(%sIn.%s.ValueOrZero()) > %d {
			return ae.StringLengthError("%s", %d)
	}`
)
View Source
const (
	COLUMN_W_GORM  = "\t\t%s\t%s\t`db:\"%s\" json:\"%s\" gorm:\"column:%s\"`"
	COLUMN_WO_GORM = "\t\t%s\t%s\t`db:\"%s\" json:\"%s\"`"
)

Variables

View Source
var (
	PostTests map[string]m.ColumnTest
	PutTests  map[string]m.ColumnTest
)

const down at the bottom

Functions

func AppendColumnTest

func AppendColumnTest(name, goType, dbType string, justPut bool)

func BuildStorage

func BuildStorage(project *m.Project)

func InitializeColumnTests

func InitializeColumnTests()

func PopulateConfig

func PopulateConfig(projectFile *m.ProjectFile)

func StartTemplating

func StartTemplating(project *m.Project)

func TranslateType

func TranslateType(columnName, columnType, dbType string, length int, valid bool) string

func UpdateModFiles

func UpdateModFiles(projectName string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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