Documentation ¶
Index ¶
- Variables
- func ExecuteAny(value any, args ...Option) string
- func ExecuteString(typeName string, packagePath string, args ...Option) string
- func ExecuteType(typ reflect.Type, args ...Option) string
- func OptionTypeName(applyeeName string) string
- func OptionVarName(fieldName, postfix string) string
- func TodoImports(pkg *packages.Package)
- type Field
- type Gen
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var WithAutoimports = func(autoImports bool) func(o *option) {
return func(o *option) {
o.autoImports = autoImports
}
}
View Source
var WithPostfix = func(postfix string) func(o *option) {
return func(o *option) {
o.postfix = postfix
}
}
View Source
var WithWriteFile = func(writeFile string) func(o *option) {
return func(o *option) {
o.writeFile = writeFile
}
}
Functions ¶
func ExecuteAny ¶
func OptionTypeName ¶
OptionTypeName give the option type a proper name replace xxxOptions --> XXXOption replace xxxConfig --> XXXOption replace xxxConfigs --> XXXOption
func OptionVarName ¶
OptionVarName give the option variable a proper name
func TodoImports ¶
TODO: currently, the implementation doesn't understand package alias implement this function in future need
Types ¶
type Gen ¶
Gen is a wide type which will be rendered with a bunch of templates
func LoadDefinition ¶
func (Gen) FieldNameByIndex ¶
func (Gen) FieldTypeByIndex ¶
func (Gen) ParamNameByIndex ¶ added in v1.0.2
func (Gen) RenderApplyFunc ¶
func (Gen) RenderOptionType ¶
func (Gen) RenderOptionVariable ¶
Click to show internal directories.
Click to hide internal directories.