Documentation
¶
Index ¶
- Variables
- func EnumReplace(value string) string
- func EnumValueName(value string) string
- func FindValues(val string) string
- func Generate(r *compiler.Result, settings config.CombinedSettings) (map[string]string, error)
- func MatchValues(val string) bool
- func RepeatN(val string, n int) string
- func ReplaceAllString(val string) string
- func StructName(name string, settings config.CombinedSettings) string
- type Constant
- type Enum
- type Field
- type Generateable
- type ImportSpec
- type Query
- type QueryValue
- func (v QueryValue) ContainSlice() bool
- func (v QueryValue) EmitStruct() bool
- func (v QueryValue) GenerateFunctions() string
- func (v QueryValue) GetDefaultValueByType() string
- func (v QueryValue) IsInsertRepeatValues() bool
- func (v QueryValue) IsSliceType() bool
- func (v QueryValue) IsStruct() bool
- func (v QueryValue) Pair() string
- func (v QueryValue) Params() string
- func (v QueryValue) Scan() string
- func (v QueryValue) ShouldGenFunctions() bool
- func (v QueryValue) ShouldGenFunctionsImport() bool
- func (v QueryValue) Type() string
- type Struct
Constants ¶
This section is empty.
Variables ¶
View Source
var IdentPattern = regexp.MustCompile("[^a-zA-Z0-9_]+")
Functions ¶
func EnumReplace ¶
func EnumValueName ¶
func FindValues ¶ added in v1.15.0
func MatchValues ¶ added in v1.15.0
func ReplaceAllString ¶ added in v1.15.0
func StructName ¶
func StructName(name string, settings config.CombinedSettings) string
Types ¶
type Generateable ¶
type Generateable interface { Structs(settings config.CombinedSettings) []Struct GoQueries(settings config.CombinedSettings) []Query Enums(settings config.CombinedSettings) []Enum }
type ImportSpec ¶
func (ImportSpec) String ¶
func (s ImportSpec) String() string
type Query ¶
type Query struct { Cmd string Comments []string MethodName string FieldName string ConstantName string SQL string RepeatPattern string SourceName string Ret QueryValue Arg QueryValue }
A struct used to generate methods and fields on the Queries struct
type QueryValue ¶
type QueryValue struct { Emit bool Name string Struct *Struct Typ string IsSlice bool IsRepeatValues bool //插入多个值 Slice []*QueryValue NameSpace string }
func (QueryValue) ContainSlice ¶
func (v QueryValue) ContainSlice() bool
func (QueryValue) EmitStruct ¶
func (v QueryValue) EmitStruct() bool
func (QueryValue) GenerateFunctions ¶
func (v QueryValue) GenerateFunctions() string
func (QueryValue) GetDefaultValueByType ¶ added in v1.13.9
func (v QueryValue) GetDefaultValueByType() string
func (QueryValue) IsInsertRepeatValues ¶ added in v1.15.0
func (v QueryValue) IsInsertRepeatValues() bool
func (QueryValue) IsSliceType ¶
func (v QueryValue) IsSliceType() bool
func (QueryValue) IsStruct ¶
func (v QueryValue) IsStruct() bool
func (QueryValue) Pair ¶
func (v QueryValue) Pair() string
func (QueryValue) Params ¶
func (v QueryValue) Params() string
func (QueryValue) Scan ¶
func (v QueryValue) Scan() string
func (QueryValue) ShouldGenFunctions ¶ added in v1.13.7
func (v QueryValue) ShouldGenFunctions() bool
func (QueryValue) ShouldGenFunctionsImport ¶ added in v1.13.8
func (v QueryValue) ShouldGenFunctionsImport() bool
func (QueryValue) Type ¶
func (v QueryValue) Type() string
Click to show internal directories.
Click to hide internal directories.