Documentation ¶
Index ¶
- Variables
- func Action(c *cli.Context) error
- type CustomAssign
- type Field
- type Generator
- func (g *Generator) AddImport(name string, path string) string
- func (g *Generator) Generate(yamlConf *YamlConfig) error
- func (g *Generator) PrepareAssigns(assignConf map[string]YamlCustomAssign)
- func (g *Generator) PrepareImports(imports map[string]string)
- func (g *Generator) PrepareTaskes(taskConf map[string]YamlTaskElem)
- func (g *Generator) Run()
- type ImportLine
- type StructInfo
- type TaskGenerator
- type Type
- type YamlConfig
- type YamlCustomAssign
- type YamlTaskElem
Constants ¶
This section is empty.
Variables ¶
View Source
var Description = "As default, it will read task defination from stdin, if --file was given, it would read from the file."
View Source
var Flags = []cli.Flag{ cli.StringFlag{ Name: "file,f", Usage: "read task defination from `FILE`", }, cli.StringFlag{ Name: "source,s", Usage: "the `TYPE` convert fromt", }, cli.StringFlag{ Name: "target,t", Usage: "the `TYPE` convert to", }, cli.StringFlag{ Name: "name", Usage: "the convert `FUNCTION` name ", }, cli.StringSliceFlag{ Name: "assign,a", Usage: "the exists covnert functions", }, cli.StringFlag{ Name: "error", Usage: "the error returns", }, cli.StringFlag{ Name: "output,o", Usage: "the `FILE` to output", }, cli.StringSliceFlag{ Name: "import,i", Usage: "the requried imports", }, cli.StringFlag{ Name: "tag,g", Usage: "the tag name", Value: "pc", }, }
View Source
var Usage = "convert one type to another"
Functions ¶
Types ¶
type CustomAssign ¶
type Generator ¶
type Generator struct { generator.Generator TagName string Imports []ImportLine CustomAssigns []*CustomAssign Resolves []string IgnoreImportPaths []string // contains filtered or unexported fields }
func NewGenerator ¶
func NewGenerator() *Generator
func (*Generator) Generate ¶
func (g *Generator) Generate(yamlConf *YamlConfig) error
func (*Generator) PrepareAssigns ¶
func (g *Generator) PrepareAssigns(assignConf map[string]YamlCustomAssign)
func (*Generator) PrepareImports ¶
func (*Generator) PrepareTaskes ¶
func (g *Generator) PrepareTaskes(taskConf map[string]YamlTaskElem)
type ImportLine ¶
func (ImportLine) String ¶
func (l ImportLine) String() string
type StructInfo ¶
func NewStructInfo ¶
func NewStructInfo(origin string) *StructInfo
func (*StructInfo) Print ¶
func (si *StructInfo) Print()
type TaskGenerator ¶
type TaskGenerator struct { Parent *Generator Tpaths []*parser.TPath FuncBuilder builder.Builder Task *genTask Error ast.Expr }
func (*TaskGenerator) Run ¶
func (tg *TaskGenerator) Run() bool
type YamlConfig ¶
type YamlCustomAssign ¶
Click to show internal directories.
Click to hide internal directories.