Documentation ¶
Index ¶
- func Contains[T comparable](arr []T, a T) bool
- func JoinAround(strs []string, left, right, separator string) string
- func MergeMaps(m, m2 map[string]string)
- func Register(gen Plugin)
- func ScanAndGenerateFile(workDir, fullFileName string)
- func ScanCurrentDir(options ...ScanOption)
- func ScanCurrentDirAndSubDirs(options ...ScanOption)
- func ScanDir(dir string, options ...ScanOption)
- func ScanDirAndSubDirs(dir string, options ...ScanOption)
- func SetGenSuffix(s string)
- func UncapFirst(s string) string
- func UncapFirstSingle(s string) string
- func Unregister(gen Plugin)
- func UnregisterAll()
- func Zero(typ string) (string, bool)
- type Array
- type Basic
- type Field
- type Interface
- func (s *Interface) AddMethod(m Method)
- func (s *Interface) FindMethod(name string) (Method, bool)
- func (s *Interface) GetDir() []string
- func (s *Interface) GetFields() []Field
- func (s *Interface) GetMethods() []Method
- func (s *Interface) GetName() string
- func (s *Interface) GetPackage() string
- func (s *Interface) GetTags() Tags
- func (s *Interface) Type() MapperType
- type InterfaceVar
- type Kinder
- type Map
- type Mapper
- type MapperType
- type Method
- func (m *Method) Call(withName bool) string
- func (m *Method) ContextArgName() string
- func (m *Method) HasResults() bool
- func (m *Method) IsExported() bool
- func (m *Method) Name() string
- func (m *Method) NamedReturns() string
- func (m *Method) Parameters(onlyName bool) string
- func (m *Method) ReturnAssignments() (all string, errVar string)
- func (m *Method) ReturnZerosWithError(errVar string) string
- func (m *Method) Returns() string
- func (m *Method) Signature(withName bool) string
- func (m *Method) String() string
- func (Method) Zero() string
- func (Method) ZeroCondition(field string) string
- type Parser
- type Plugin
- type Pointer
- type ScanOption
- type ScanOptions
- type Scribler
- func (s *Scribler) BPrint(args ...interface{})
- func (s *Scribler) BPrintf(format string, args ...interface{})
- func (s *Scribler) BPrintln(args ...interface{})
- func (s *Scribler) Flush() []byte
- func (s *Scribler) HPrint(args ...interface{})
- func (s *Scribler) HPrintf(format string, args ...interface{})
- func (s *Scribler) HPrintln(args ...interface{})
- func (s Scribler) Len() int
- func (s Scribler) String() string
- type Struct
- func (s *Struct) AddMethod(m Method)
- func (s *Struct) FindMethod(name string) (Method, bool)
- func (s *Struct) GetDir() []string
- func (s *Struct) GetFields() []Field
- func (s *Struct) GetMethods() []Method
- func (s *Struct) GetName() string
- func (s *Struct) GetPackage() string
- func (s *Struct) GetTags() Tags
- func (s *Struct) Type() MapperType
- type Tag
- type Tags
- type TypeEnum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶ added in v0.4.0
func Contains[T comparable](arr []T, a T) bool
func JoinAround ¶ added in v0.3.0
func ScanAndGenerateFile ¶ added in v0.5.0
func ScanAndGenerateFile(workDir, fullFileName string)
func ScanCurrentDir ¶
func ScanCurrentDir(options ...ScanOption)
func ScanCurrentDirAndSubDirs ¶
func ScanCurrentDirAndSubDirs(options ...ScanOption)
func ScanDir ¶ added in v0.5.0
func ScanDir(dir string, options ...ScanOption)
func ScanDirAndSubDirs ¶ added in v0.5.0
func ScanDirAndSubDirs(dir string, options ...ScanOption)
func SetGenSuffix ¶ added in v0.5.0
func SetGenSuffix(s string)
func UncapFirst ¶
func UncapFirstSingle ¶ added in v0.2.0
func Unregister ¶ added in v0.5.0
func Unregister(gen Plugin)
func UnregisterAll ¶ added in v0.5.0
func UnregisterAll()
Types ¶
type Basic ¶
func (Basic) ZeroCondition ¶ added in v0.2.0
type Field ¶
func (Field) IsPrimitive ¶ added in v0.2.2
func (Field) NameForField ¶ added in v0.2.0
func (Field) NameOrKindName ¶
type Interface ¶ added in v0.2.2
func (*Interface) FindMethod ¶ added in v0.4.0
func (*Interface) GetMethods ¶ added in v0.4.0
func (*Interface) GetPackage ¶ added in v0.6.0
func (*Interface) Type ¶ added in v0.2.2
func (s *Interface) Type() MapperType
type InterfaceVar ¶ added in v0.4.0
func (*InterfaceVar) Name ¶ added in v0.4.0
func (b *InterfaceVar) Name() string
func (*InterfaceVar) String ¶ added in v0.4.0
func (b *InterfaceVar) String() string
func (*InterfaceVar) Zero ¶ added in v0.4.0
func (b *InterfaceVar) Zero() string
func (*InterfaceVar) ZeroCondition ¶ added in v0.4.0
func (b *InterfaceVar) ZeroCondition(field string) string
type Map ¶
func (Map) ZeroCondition ¶ added in v0.2.0
type MapperType ¶ added in v0.4.0
type MapperType string
const ( StructMapper MapperType = "struct" InterfaceMapper MapperType = "interface" )
type Method ¶
func (*Method) ContextArgName ¶ added in v0.3.0
func (*Method) HasResults ¶ added in v0.3.0
func (*Method) IsExported ¶ added in v0.4.0
func (*Method) NamedReturns ¶ added in v0.6.0
func (*Method) Parameters ¶ added in v0.3.0
func (*Method) ReturnAssignments ¶ added in v0.6.0
HasErrorReturn returns if it has an error return and its position
func (*Method) ReturnZerosWithError ¶ added in v0.3.0
func (Method) ZeroCondition ¶ added in v0.2.0
type Parser ¶
type ScanOption ¶ added in v0.5.0
type ScanOption func(*ScanOptions)
func WithDirOut ¶ added in v0.5.0
func WithDirOut(dirOut string) ScanOption
type ScanOptions ¶ added in v0.5.0
type ScanOptions struct {
// contains filtered or unexported fields
}
type Struct ¶
func (*Struct) GetMethods ¶ added in v0.4.0
func (*Struct) GetPackage ¶ added in v0.6.0
func (*Struct) Type ¶ added in v0.4.0
func (s *Struct) Type() MapperType
Click to show internal directories.
Click to hide internal directories.