Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFieldName ¶
ExtractFieldName extracts the field name from an ast.Expr using reflection
Types ¶
type Config ¶
type Config struct { GoPath string `yaml:"go_path"` TemplatePath string `yaml:"template_path"` Name string `yaml:"name"` OutputPath string `yaml:"output_path"` RemoveFields RemoveFieldsTransformer `yaml:"remove_fields"` }
type FieldTypeAndNameTransformer ¶
type FieldTypeAndNameTransformer struct{}
func (*FieldTypeAndNameTransformer) Transform ¶
func (t *FieldTypeAndNameTransformer) Transform(ctx *TemplateContext) error
type RemoveFieldsTransformer ¶
func (*RemoveFieldsTransformer) Transform ¶
func (t *RemoveFieldsTransformer) Transform(c *TemplateContext) error
type StructConfig ¶
type TemplateContext ¶
type Templater ¶
type Templater struct { Transformers map[string]TransformerFn // contains filtered or unexported fields }
func NewTemplater ¶
func NewTemplaterFromPath ¶
func (*Templater) AddTransformer ¶
func (t *Templater) AddTransformer(name string, fn TransformerFn)
func (*Templater) GenerateFiles ¶
func (*Templater) RunTransformers ¶
func (t *Templater) RunTransformers()
type TransformerFn ¶
type TransformerFn func(ctx *TemplateContext) error
Click to show internal directories.
Click to hide internal directories.