Documentation ¶
Index ¶
- Constants
- func TemplateHelperShapeVariantToName(x shape.Shape) string
- 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) OptionallyImport(x string) string
- func (g *DeSerJSONGenerator) SupportNativeJSONMarshal(x shape.Shape) bool
- 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 SchemaGenerator
- type ShapeGenerator
- 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) OptionallyImport ¶ added in v1.20.2
func (g *DeSerJSONGenerator) OptionallyImport(x string) string
func (*DeSerJSONGenerator) SupportNativeJSONMarshal ¶ added in v1.20.1
func (g *DeSerJSONGenerator) SupportNativeJSONMarshal(x shape.Shape) bool
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 SchemaGenerator ¶
func NewSchemaGenerator ¶
func NewSchemaGenerator(union *shape.UnionLike, helper *Helpers) *SchemaGenerator
func (*SchemaGenerator) Generate ¶
func (g *SchemaGenerator) Generate() ([]byte, error)
func (*SchemaGenerator) VariantName ¶ added in v1.20.2
func (g *SchemaGenerator) VariantName(x shape.Shape) string
type ShapeGenerator ¶
func NewShapeGenerator ¶
func NewShapeGenerator(union *shape.UnionLike, helper *Helpers) *ShapeGenerator
func (*ShapeGenerator) Generate ¶
func (g *ShapeGenerator) Generate() ([]byte, error)
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 VisitorGenerator ¶
func NewVisitorGenerator ¶
func NewVisitorGenerator(union *shape.UnionLike, helper *Helpers) *VisitorGenerator
func (*VisitorGenerator) Generate ¶
func (g *VisitorGenerator) Generate() ([]byte, error)
func (*VisitorGenerator) VariantName ¶ added in v1.20.2
func (g *VisitorGenerator) VariantName(x shape.Shape) string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.