Documentation
¶
Index ¶
- Constants
- Variables
- func FieldLikeToString(x *shape.FieldLike, removeTypeName bool) string
- func GenerateImports(pkgMap PkgMap) string
- func GenerateInitFunc(inits InitFuncs) string
- func GuardToString(x shape.Guard) string
- func KindToGoName(kind shape.NumberKind) string
- func PtrToString(x *string) string
- func ShapeToString(x shape.Shape) string
- func TagToStr(x shape.Tag, removeTypeName bool) string
- func TagsToStr(x map[string]shape.Tag) string
- func TemplateHelperShapeVariantToName(x shape.Shape) string
- func TypeNameIfSupports(s shape.Shape) (string, bool)
- func TypeParamToString(x shape.TypeParam) string
- type DeSerJSONGenerator
- func (g *DeSerJSONGenerator) ExtractImports(x shape.Shape) PkgMap
- func (g *DeSerJSONGenerator) Generate() ([]byte, error)
- func (g *DeSerJSONGenerator) GenerateImports(pkgMap PkgMap) (string, error)
- func (g *DeSerJSONGenerator) IsStruct(x shape.Shape) bool
- func (g *DeSerJSONGenerator) JSONVariantName(x shape.Shape) string
- func (g *DeSerJSONGenerator) Serde(x shape.Shape) string
- func (g *DeSerJSONGenerator) SkipImportsAndPackage(x bool)
- func (g *DeSerJSONGenerator) VariantName(x shape.Shape) string
- type DeriveFuncMatchGenerator
- type FunctionMatchGenerator
- type Generator
- type InferredDeriveFuncMatchInfo
- type InitFuncs
- type MatchBuilder
- type MatchSpec
- type PkgMap
- type SerdeJSONTagged
- func (g *SerdeJSONTagged) ExtractImports(x shape.Shape) PkgMap
- func (g *SerdeJSONTagged) Generate() (string, error)
- func (g *SerdeJSONTagged) GenerateImports(pkgMap PkgMap) (string, error)
- func (g *SerdeJSONTagged) GenerateMarshalJSON(x shape.Shape) (string, error)
- func (g *SerdeJSONTagged) GenerateMarshalJSONMethods(x shape.Shape) (string, error)
- func (g *SerdeJSONTagged) GenerateUnmarshalJSON(x shape.Shape) (string, error)
- func (g *SerdeJSONTagged) GenerateUnmarshalJSONMethods(x shape.Shape) (string, error)
- func (g *SerdeJSONTagged) GenerateVarCasting(x shape.Shape) (string, error)
- func (g *SerdeJSONTagged) SkipImportsAndPackage(flag bool) *SerdeJSONTagged
- type ShapeTagged
- func (g *ShapeTagged) ExtractImportFuncs(s shape.Shape) []string
- func (g *ShapeTagged) ExtractImports(x shape.Shape) PkgMap
- func (g *ShapeTagged) Generate() (string, error)
- func (g *ShapeTagged) GenerateImports(pkgMap PkgMap) (string, error)
- func (g *ShapeTagged) GenerateInitFunc(init []string) (string, error)
- func (g *ShapeTagged) SkipImportsAndPackage(flag bool) *ShapeTagged
- func (g *ShapeTagged) SkipInitFunc(flag bool) *ShapeTagged
- type ShapeUnion
- func (g *ShapeUnion) ExtractImportFuncs(s shape.Shape) []string
- func (g *ShapeUnion) ExtractImports(x shape.Shape) PkgMap
- func (g *ShapeUnion) Generate() ([]byte, error)
- func (g *ShapeUnion) GenerateImports(pkgMap PkgMap) (string, error)
- func (g *ShapeUnion) GenerateInitFunc(init []string) (string, error)
- func (g *ShapeUnion) SkipImportsAndPackage(flag bool)
- func (g *ShapeUnion) SkipInitFunc(flag bool)
- type VisitorGenerator
- func (g *VisitorGenerator) Add(a, b int) int
- func (g *VisitorGenerator) ExtractImports(x shape.Shape) PkgMap
- func (g *VisitorGenerator) GenIntSlice(from, to int) []int
- func (g *VisitorGenerator) Generate() ([]byte, error)
- func (g *VisitorGenerator) GenerateImports(pkgMap PkgMap) (string, error)
- func (g *VisitorGenerator) SkipImportsAndPackage(flag bool)
- func (g *VisitorGenerator) VariantName(x shape.Shape) string
Constants ¶
View Source
const (
Header = `// Code generated by ` + shared.Program + `. DO NOT EDIT.`
)
Variables ¶
View Source
var (
ErrNotSupported = fmt.Errorf("type not supported for generation")
)
Functions ¶
func FieldLikeToString ¶ added in v1.21.0
func GenerateImports ¶ added in v1.21.0
func GenerateInitFunc ¶ added in v1.21.0
func GuardToString ¶ added in v1.21.0
func KindToGoName ¶ added in v1.21.0
func KindToGoName(kind shape.NumberKind) string
func PtrToString ¶ added in v1.21.0
func ShapeToString ¶ added in v1.21.0
func TypeParamToString ¶ added in v1.21.0
Types ¶
type DeSerJSONGenerator ¶
func SerdeJSONUnion ¶ added in v1.21.0
func SerdeJSONUnion(union *shape.UnionLike) *DeSerJSONGenerator
func (*DeSerJSONGenerator) ExtractImports ¶ added in v1.21.0
func (g *DeSerJSONGenerator) ExtractImports(x shape.Shape) PkgMap
func (*DeSerJSONGenerator) Generate ¶
func (g *DeSerJSONGenerator) Generate() ([]byte, error)
func (*DeSerJSONGenerator) GenerateImports ¶ added in v1.21.0
func (g *DeSerJSONGenerator) GenerateImports(pkgMap PkgMap) (string, error)
func (*DeSerJSONGenerator) JSONVariantName ¶
func (g *DeSerJSONGenerator) JSONVariantName(x shape.Shape) string
func (*DeSerJSONGenerator) Serde ¶ added in v1.21.0
func (g *DeSerJSONGenerator) Serde(x shape.Shape) string
func (*DeSerJSONGenerator) SkipImportsAndPackage ¶ added in v1.21.0
func (g *DeSerJSONGenerator) SkipImportsAndPackage(x bool)
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 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 PkgMap ¶ added in v1.21.0
func MergePkgMaps ¶ added in v1.21.0
type SerdeJSONTagged ¶ added in v1.21.0
type SerdeJSONTagged struct {
// contains filtered or unexported fields
}
func NewSerdeJSONTagged ¶ added in v1.21.0
func NewSerdeJSONTagged(shape shape.Shape) *SerdeJSONTagged
func (*SerdeJSONTagged) ExtractImports ¶ added in v1.21.0
func (g *SerdeJSONTagged) ExtractImports(x shape.Shape) PkgMap
func (*SerdeJSONTagged) Generate ¶ added in v1.21.0
func (g *SerdeJSONTagged) Generate() (string, error)
func (*SerdeJSONTagged) GenerateImports ¶ added in v1.21.0
func (g *SerdeJSONTagged) GenerateImports(pkgMap PkgMap) (string, error)
func (*SerdeJSONTagged) GenerateMarshalJSON ¶ added in v1.21.0
func (g *SerdeJSONTagged) GenerateMarshalJSON(x shape.Shape) (string, error)
func (*SerdeJSONTagged) GenerateMarshalJSONMethods ¶ added in v1.21.0
func (g *SerdeJSONTagged) GenerateMarshalJSONMethods(x shape.Shape) (string, error)
func (*SerdeJSONTagged) GenerateUnmarshalJSON ¶ added in v1.21.0
func (g *SerdeJSONTagged) GenerateUnmarshalJSON(x shape.Shape) (string, error)
func (*SerdeJSONTagged) GenerateUnmarshalJSONMethods ¶ added in v1.21.0
func (g *SerdeJSONTagged) GenerateUnmarshalJSONMethods(x shape.Shape) (string, error)
func (*SerdeJSONTagged) GenerateVarCasting ¶ added in v1.21.0
func (g *SerdeJSONTagged) GenerateVarCasting(x shape.Shape) (string, error)
func (*SerdeJSONTagged) SkipImportsAndPackage ¶ added in v1.21.0
func (g *SerdeJSONTagged) SkipImportsAndPackage(flag bool) *SerdeJSONTagged
type ShapeTagged ¶ added in v1.21.0
type ShapeTagged struct {
// contains filtered or unexported fields
}
func NewShapeTagged ¶ added in v1.21.0
func NewShapeTagged(shape shape.Shape) *ShapeTagged
func (*ShapeTagged) ExtractImportFuncs ¶ added in v1.21.0
func (g *ShapeTagged) ExtractImportFuncs(s shape.Shape) []string
func (*ShapeTagged) ExtractImports ¶ added in v1.21.0
func (g *ShapeTagged) ExtractImports(x shape.Shape) PkgMap
func (*ShapeTagged) Generate ¶ added in v1.21.0
func (g *ShapeTagged) Generate() (string, error)
func (*ShapeTagged) GenerateImports ¶ added in v1.21.0
func (g *ShapeTagged) GenerateImports(pkgMap PkgMap) (string, error)
func (*ShapeTagged) GenerateInitFunc ¶ added in v1.21.0
func (g *ShapeTagged) GenerateInitFunc(init []string) (string, error)
func (*ShapeTagged) SkipImportsAndPackage ¶ added in v1.21.0
func (g *ShapeTagged) SkipImportsAndPackage(flag bool) *ShapeTagged
func (*ShapeTagged) SkipInitFunc ¶ added in v1.21.0
func (g *ShapeTagged) SkipInitFunc(flag bool) *ShapeTagged
type ShapeUnion ¶ added in v1.21.0
type ShapeUnion struct {
// contains filtered or unexported fields
}
func NewShapeUnion ¶ added in v1.21.0
func NewShapeUnion(union *shape.UnionLike) *ShapeUnion
func (*ShapeUnion) ExtractImportFuncs ¶ added in v1.21.0
func (g *ShapeUnion) ExtractImportFuncs(s shape.Shape) []string
func (*ShapeUnion) ExtractImports ¶ added in v1.21.0
func (g *ShapeUnion) ExtractImports(x shape.Shape) PkgMap
func (*ShapeUnion) Generate ¶ added in v1.21.0
func (g *ShapeUnion) Generate() ([]byte, error)
func (*ShapeUnion) GenerateImports ¶ added in v1.21.0
func (g *ShapeUnion) GenerateImports(pkgMap PkgMap) (string, error)
func (*ShapeUnion) GenerateInitFunc ¶ added in v1.21.0
func (g *ShapeUnion) GenerateInitFunc(init []string) (string, error)
func (*ShapeUnion) SkipImportsAndPackage ¶ added in v1.21.0
func (g *ShapeUnion) SkipImportsAndPackage(flag bool)
func (*ShapeUnion) SkipInitFunc ¶ added in v1.21.0
func (g *ShapeUnion) SkipInitFunc(flag bool)
type VisitorGenerator ¶
func NewVisitorGenerator ¶
func NewVisitorGenerator(union *shape.UnionLike) *VisitorGenerator
func (*VisitorGenerator) Add ¶ added in v1.21.0
func (g *VisitorGenerator) Add(a, b int) int
func (*VisitorGenerator) ExtractImports ¶ added in v1.21.0
func (g *VisitorGenerator) ExtractImports(x shape.Shape) PkgMap
func (*VisitorGenerator) GenIntSlice ¶ added in v1.21.0
func (g *VisitorGenerator) GenIntSlice(from, to int) []int
func (*VisitorGenerator) Generate ¶
func (g *VisitorGenerator) Generate() ([]byte, error)
func (*VisitorGenerator) GenerateImports ¶ added in v1.21.0
func (g *VisitorGenerator) GenerateImports(pkgMap PkgMap) (string, error)
func (*VisitorGenerator) SkipImportsAndPackage ¶ added in v1.21.0
func (g *VisitorGenerator) SkipImportsAndPackage(flag bool)
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.