Documentation ¶
Index ¶
- Variables
- func Flags(set *pflag.FlagSet)
- func GenerateStructInterface(g *gen.Generator, decl *ast.GenDecl, typ *ast.TypeSpec, cm ast.CommentMap)
- func GetIfaceName(name string) string
- func HasPrefix(val string, ct ...string) bool
- func IsGenerateMethod(name string) bool
- func IsGenerateStruct(name string) bool
- func ParsePackages(pkg *goparse.Package, IsGenerateStruct func(name string) bool, ...) (data map[string]*StructInfo)
- func RunCommand(cmd *cobra.Command, args []string)
- type CompositeStructInfo
- type StructField
- type StructInfo
- type StructMethod
Constants ¶
This section is empty.
Variables ¶
View Source
var Version string = "0.0.7"
Version generate tool version
Functions ¶
func GenerateStructInterface ¶
func GenerateStructInterface(g *gen.Generator, decl *ast.GenDecl, typ *ast.TypeSpec, cm ast.CommentMap)
GenerateStructInterface generate struct interface
func GetIfaceName ¶
func ParsePackages ¶
func ParsePackages(pkg *goparse.Package, IsGenerateStruct func(name string) bool, IsGenerateMethod func(name string) bool, dstPackage string, ) (data map[string]*StructInfo)
parse dst package. collecte structs infos
func RunCommand ¶
RunCommand run generate command
Types ¶
type CompositeStructInfo ¶
type StructField ¶
func (*StructField) String ¶
func (f *StructField) String() string
type StructInfo ¶
type StructInfo struct { Typ string Composites []*CompositeStructInfo Doc string Comment string Methods []*StructMethod // contains filtered or unexported fields }
type StructMethod ¶
type StructMethod struct { Doc string Comment string Name string Params []*StructField Results []*StructField // contains filtered or unexported fields }
func (*StructMethod) Args ¶
func (m *StructMethod) Args() string
func (*StructMethod) Args2 ¶
func (m *StructMethod) Args2() string
func (*StructMethod) Rets ¶
func (m *StructMethod) Rets() string
func (*StructMethod) String ¶
func (m *StructMethod) String() string
Click to show internal directories.
Click to hide internal directories.