Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Nil is nil check types Nil = "nil" // Zero is 0 check types Zero = "zero" // PZero is 0 check types for pointers PZero = "pzero" // Len is length check types Len = "len" // PLen is length check types for pointers PLen = "plen" // Enum is allowed values check types Enum = "enum" // PEnum is allowed values check types for pointers PEnum = "penum" )
View Source
const Template = `` /* 1527-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
base.Options
// Package sets package name for model
// Works only with SchemaPackage = false
Package string
// Do not replace primary key name to ID
KeepPK bool
}
Options for generator
type TemplateColumn ¶
TemplateColumn stores column info
func NewTemplateColumn ¶
func NewTemplateColumn(column model.Column, options Options) TemplateColumn
NewTemplateColumn creates a column for template
type TemplateEntity ¶
type TemplateEntity struct {
model.Entity
Columns []TemplateColumn
Imports []string
}
TemplateEntity stores struct info
func NewTemplateEntity ¶
func NewTemplateEntity(entity model.Entity, options Options) TemplateEntity
NewTemplateEntity creates an entity for template
type TemplatePackage ¶
type TemplatePackage struct {
Package string
HasImports bool
Imports []string
Entities []TemplateEntity
}
TemplatePackage stores package info
func NewTemplatePackage ¶
func NewTemplatePackage(entities []model.Entity, options Options) TemplatePackage
NewTemplatePackage creates a package for template
type Validate ¶
type Validate struct {
// contains filtered or unexported fields
}
Validate represents validate generator
func (*Validate) SetOptions ¶
SetOptions sets options
Click to show internal directories.
Click to hide internal directories.