Documentation ¶
Index ¶
- Constants
- func AdaptUnionToOldVersionOfGenerator(union shape.UnionLike) ([]string, map[string][]Branching)
- func PtrStr(x string) *string
- func TemplateHelperShapeVariantToName(x shape.Shape) string
- type Branching
- type DeSerJSONGenerator
- func (g *DeSerJSONGenerator) Generate() ([]byte, error)
- func (g *DeSerJSONGenerator) IsStruct(x shape.Shape) bool
- func (g *DeSerJSONGenerator) JSONFieldName(x shape.FieldLike) string
- func (g *DeSerJSONGenerator) JSONVariantName(x shape.Shape) string
- func (g *DeSerJSONGenerator) MarshalTemplate(field *shape.FieldLike, depth int) string
- func (g *DeSerJSONGenerator) UnmarshalTemplate(field *shape.FieldLike, depth int) string
- func (g *DeSerJSONGenerator) VariantName(x shape.Shape) string
- type DeriveFuncMatchGenerator
- type FunctionMatchGenerator
- type GenerateOption
- type Generator
- type Helpers
- type InferredDeriveFuncMatchInfo
- type MatchBuilder
- type MatchSpec
- type ReducerBreadthFirstGenerator
- type ReducerDefaultReductionGenerator
- type ReducerDepthFirstGenerator
- type SchemaGenerator
- type ShapeGenerator
- type VisitorDefaultGenerator
- type VisitorGenerator
Constants ¶
View Source
const (
Header = `// Code generated by ` + shared.Program + `. DO NOT EDIT.`
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeSerJSONGenerator ¶
func NewDeSerJSONGenerator ¶
func NewDeSerJSONGenerator(union shape.UnionLike, helper *Helpers) *DeSerJSONGenerator
func (*DeSerJSONGenerator) Generate ¶
func (g *DeSerJSONGenerator) Generate() ([]byte, error)
func (*DeSerJSONGenerator) JSONFieldName ¶
func (g *DeSerJSONGenerator) JSONFieldName(x shape.FieldLike) string
func (*DeSerJSONGenerator) JSONVariantName ¶
func (g *DeSerJSONGenerator) JSONVariantName(x shape.Shape) string
func (*DeSerJSONGenerator) MarshalTemplate ¶
func (g *DeSerJSONGenerator) MarshalTemplate(field *shape.FieldLike, depth int) string
func (*DeSerJSONGenerator) UnmarshalTemplate ¶
func (g *DeSerJSONGenerator) UnmarshalTemplate(field *shape.FieldLike, depth int) string
func (*DeSerJSONGenerator) VariantName ¶
func (g *DeSerJSONGenerator) VariantName(x shape.Shape) string
type DeriveFuncMatchGenerator ¶
func (*DeriveFuncMatchGenerator) Generate ¶
func (g *DeriveFuncMatchGenerator) Generate() ([]byte, error)
type FunctionMatchGenerator ¶
func (*FunctionMatchGenerator) Generate ¶
func (t *FunctionMatchGenerator) Generate() ([]byte, error)
type GenerateOption ¶
type GenerateOption func(o *generatorOptions)
func WithBufferedImports ¶
func WithBufferedImports() GenerateOption
func WithPackageName ¶
func WithPackageName(name string) GenerateOption
type Helpers ¶
type Helpers struct {
// contains filtered or unexported fields
}
func NewHelper ¶
func NewHelper(fs ...GenerateOption) *Helpers
func (*Helpers) RenderBufferedHeader ¶
func (*Helpers) RenderBufferedImport ¶
func (*Helpers) RenderHeader ¶
func (*Helpers) RenderImport ¶
type InferredDeriveFuncMatchInfo ¶
type InferredDeriveFuncMatchInfo struct { PackageName string // contains filtered or unexported fields }
func InferDeriveFuncMatchFromFile ¶
func InferDeriveFuncMatchFromFile(filename string) (*InferredDeriveFuncMatchInfo, error)
type MatchBuilder ¶
type MatchBuilder struct {
// contains filtered or unexported fields
}
func NewMatchBuilder ¶
func NewMatchBuilder() *MatchBuilder
func (*MatchBuilder) Build ¶
func (b *MatchBuilder) Build() (*MatchSpec, error)
func (*MatchBuilder) SetInputs ¶
func (b *MatchBuilder) SetInputs(types ...string) error
func (*MatchBuilder) SetName ¶
func (b *MatchBuilder) SetName(name string) error
type ReducerBreadthFirstGenerator ¶
type ReducerBreadthFirstGenerator struct { Name variantName Types []typeName Branches map[typeName][]Branching Helper *Helpers // contains filtered or unexported fields }
func NewReducerBreadthFirstGenerator ¶
func NewReducerBreadthFirstGenerator( union shape.UnionLike, helper *Helpers, ) *ReducerBreadthFirstGenerator
func (*ReducerBreadthFirstGenerator) Generate ¶
func (t *ReducerBreadthFirstGenerator) Generate() ([]byte, error)
type ReducerDefaultReductionGenerator ¶
type ReducerDefaultReductionGenerator struct { Name variantName Types []typeName Helper *Helpers // contains filtered or unexported fields }
func NewReducerDefaultReductionGenerator ¶
func NewReducerDefaultReductionGenerator( union shape.UnionLike, helper *Helpers, ) *ReducerDefaultReductionGenerator
func (*ReducerDefaultReductionGenerator) Generate ¶
func (t *ReducerDefaultReductionGenerator) Generate() ([]byte, error)
type ReducerDepthFirstGenerator ¶
type ReducerDepthFirstGenerator struct { Name variantName Types []typeName Branches map[typeName][]Branching // contains filtered or unexported fields }
func NewReducerDepthFirstGenerator ¶
func NewReducerDepthFirstGenerator(union shape.UnionLike, helper *Helpers) *ReducerDepthFirstGenerator
func (*ReducerDepthFirstGenerator) Generate ¶
func (t *ReducerDepthFirstGenerator) Generate() ([]byte, error)
type SchemaGenerator ¶
type SchemaGenerator struct { Types []string Name string Helper *Helpers // contains filtered or unexported fields }
func NewSchemaGenerator ¶
func NewSchemaGenerator(union shape.UnionLike, helper *Helpers) *SchemaGenerator
func (*SchemaGenerator) Generate ¶
func (g *SchemaGenerator) Generate() ([]byte, error)
type ShapeGenerator ¶
func NewShapeGenerator ¶
func NewShapeGenerator(union shape.UnionLike, helper *Helpers) *ShapeGenerator
func (*ShapeGenerator) Generate ¶
func (g *ShapeGenerator) Generate() ([]byte, error)
func (*ShapeGenerator) ImportPkg ¶
func (g *ShapeGenerator) ImportPkg() []string
func (*ShapeGenerator) ShapeToString ¶
func (g *ShapeGenerator) ShapeToString(x shape.Shape, depth int) string
func (*ShapeGenerator) VariantName ¶
func (g *ShapeGenerator) VariantName(x shape.Shape) string
type VisitorDefaultGenerator ¶
type VisitorDefaultGenerator struct { Name string Types []string Helper *Helpers // contains filtered or unexported fields }
func NewVisitorDefaultGenerator ¶
func NewVisitorDefaultGenerator(union shape.UnionLike, helper *Helpers) *VisitorDefaultGenerator
func (*VisitorDefaultGenerator) Generate ¶
func (g *VisitorDefaultGenerator) Generate() ([]byte, error)
type VisitorGenerator ¶
type VisitorGenerator struct { Types []string Name string Helper *Helpers // contains filtered or unexported fields }
func NewVisitorGenerator ¶
func NewVisitorGenerator(union shape.UnionLike, helper *Helpers) *VisitorGenerator
func (*VisitorGenerator) Generate ¶
func (g *VisitorGenerator) Generate() ([]byte, error)
Source Files ¶
- derive_func_match_generator.go
- deser_json_generator.go
- infer_derive_func_builder.go
- infer_derive_func_match.go
- match_generator.go
- reducer_breadth_first_generator.go
- reducer_default_reduction_generator.go
- reducer_depth_first_generator.go
- schema_generator.go
- shape_generator.go
- visitor_default_generator.go
- visitor_generator.go
Click to show internal directories.
Click to hide internal directories.