helper

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TextArg         = "Arg"
	TextCommaSpace  = ", "
	TextDrop        = "Drop"
	TextElse        = "{%% else %%}"
	TextElseExtra   = "{%%%% else %%%%}"
	TextEndAnchor   = "</a>"
	TextEndFunc     = "{%% endfunc %%}"
	TextEndIf       = "{%% endif %%}"
	TextEndIfExtra  = "{%%%% endif %%%%}"
	TextEndIfDash   = "{%%- endif -%%}"
	TextGetBy       = "GetBy"
	TextH3Start     = "<h3>"
	TextH3End       = "</h3>"
	TextIsNull      = " is null"
	TextMenuItem    = "menuItem"
	TextModelPrefix = "model."
	TextNil         = "<nil>"
	TextNull        = "null"
	TextSQLComment  = "-- "
	TextTDEnd       = "</td>"
	TextTDStart     = `<td class="nowrap">`
	TextTmplEnd     = " %%}"
)

Variables

View Source
var (
	ImpAudit          = AppImport("lib/audit")
	ImpApp            = &model.Import{Type: model.ImportTypeApp, Value: "{{{ .Package }}}/app"}
	ImpAppController  = AppImport("controller")
	ImpAppDatabase    = AppImport("lib/database")
	ImpAppMenu        = AppImport("lib/menu")
	ImpAppNumeric     = AppImport("util/numeric")
	ImpAppSvc         = AppImport("lib/svc")
	ImpAppUtil        = AppImport("util")
	ImpContext        = model.NewImport(model.ImportTypeInternal, "context")
	ImpComponents     = ViewImport("components")
	ImpComponentsView = ViewImport("components/view")
	ImpComponentsEdit = ViewImport("components/edit")
	ImpCutil          = AppImport("controller/cutil")
	ImpDBDriver       = model.NewImport(model.ImportTypeInternal, "database/sql/driver")
	ImpErrors         = model.NewImport(model.ImportTypeExternal, "github.com/pkg/errors")
	ImpHTTP           = model.NewImport(model.ImportTypeInternal, "net/http")
	ImpFilter         = AppImport("lib/filter")
	ImpFmt            = model.NewImport(model.ImportTypeInternal, "fmt")
	ImpLayout         = ViewImport("layout")
	ImpLo             = model.NewImport(model.ImportTypeExternal, "github.com/samber/lo")
	ImpMSSQL          = model.NewImport(model.ImportTypeExternal, "github.com/denisenkom/go-mssqldb").WithAlias("mssql")
	ImpPath           = model.NewImport(model.ImportTypeInternal, "path")
	ImpRouter         = model.NewImport(model.ImportTypeExternal, "github.com/gorilla/mux")
	ImpSearchResult   = AppImport("lib/search/result")
	ImpSlices         = model.NewImport(model.ImportTypeInternal, "slices")
	ImpSQLx           = model.NewImport(model.ImportTypeExternal, "github.com/jmoiron/sqlx")
	ImpStrconv        = model.NewImport(model.ImportTypeInternal, "strconv")
	ImpStrings        = model.NewImport(model.ImportTypeInternal, "strings")
	ImpTime           = model.NewImport(model.ImportTypeInternal, "time")
	ImpURL            = model.NewImport(model.ImportTypeInternal, "net/url")
	ImpUUID           = model.NewImport(model.ImportTypeExternal, "github.com/google/uuid")
	ImpXML            = model.NewImport(model.ImportTypeInternal, "encoding/xml")
)

Functions

func AppImport

func AppImport(path string) *model.Import

func EnumImports added in v1.0.9

func EnumImports(ts types.Types, pkg string, enums enum.Enums) (model.Imports, error)

func GoArgsWithRef added in v1.9.0

func GoArgsWithRef(cols model.Columns, pkg string, args *metamodel.Args) (string, error)

func GoTypeWithRef added in v1.9.0

func GoTypeWithRef(c *model.Column, pkg string, args *metamodel.Args) string

func ImportsForTypes

func ImportsForTypes(ctx string, database string, ts ...types.Type) model.Imports

func LoadRef added in v1.5.24

func LoadRef(col *model.Column, models model.Models, events model.Events, extraTypes model.Models) (*types.Reference, metamodel.StringProvider, error)

func SimpleJSON added in v1.0.23

func SimpleJSON(database string) bool

func SpecialImports added in v0.6.20

func SpecialImports(cols model.Columns, pkg string, args *metamodel.Args) (model.Imports, error)

func ViewImport added in v1.0.11

func ViewImport(path string) *model.Import

Types

This section is empty.

Jump to

Keyboard shortcuts

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