Documentation ¶
Index ¶
- func GenerateTypeParams(registry *TypeFormatterRegistry, named *types.Named) string
- func GetFieldName(f *types.Var) string
- func GetJSONFieldName(tag string, mode options.Mode) string
- type AliasFormatter
- type ArrayFormatter
- type ConcreteStructFormatter
- func (t *ConcreteStructFormatter) Annotation(expr *types.TypeName) string
- func (f *ConcreteStructFormatter) CanFormat(expr types.Type) bool
- func (f *ConcreteStructFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *ConcreteStructFormatter) Deserialization(expr *types.TypeName) string
- func (f *ConcreteStructFormatter) Name(expr *types.TypeName, includeTypeParams bool) string
- func (f *ConcreteStructFormatter) Serialization(expr *types.TypeName) string
- func (f *ConcreteStructFormatter) Signature(expr types.Type) string
- type GenericStructFormatter
- func (f *GenericStructFormatter) Annotation(expr *types.TypeName) string
- func (f *GenericStructFormatter) CanFormat(expr types.Type) bool
- func (f *GenericStructFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *GenericStructFormatter) Deserialization(expr *types.TypeName) string
- func (f *GenericStructFormatter) Name(expr *types.TypeName, includeTypeParams bool) string
- func (f *GenericStructFormatter) Serialization(expr *types.TypeName) string
- func (f *GenericStructFormatter) Signature(expr types.Type) string
- type MapFormatter
- type PointerFormatter
- type PrimitiveFormatter
- type StructFormatter
- type TimeFormatter
- type TypeFormatter
- type TypeFormatterBase
- type TypeFormatterRegistry
- type TypeParamsFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTypeParams ¶
func GenerateTypeParams(registry *TypeFormatterRegistry, named *types.Named) string
func GetFieldName ¶
Types ¶
type AliasFormatter ¶
type AliasFormatter struct {
TypeFormatterBase
}
func (*AliasFormatter) Constructor ¶
func (f *AliasFormatter) Constructor(fieldName string, expr types.Type) string
func (*AliasFormatter) Declaration ¶
func (f *AliasFormatter) Declaration(fieldName string, expr types.Type) string
type ArrayFormatter ¶
type ArrayFormatter struct {
TypeFormatterBase
}
func (*ArrayFormatter) Declaration ¶
func (f *ArrayFormatter) Declaration(fieldName string, expr types.Type) string
func (*ArrayFormatter) DefaultValue ¶
func (f *ArrayFormatter) DefaultValue(expr types.Type) string
type ConcreteStructFormatter ¶
type ConcreteStructFormatter struct {
TypeFormatterBase
}
func (*ConcreteStructFormatter) Annotation ¶
func (t *ConcreteStructFormatter) Annotation(expr *types.TypeName) string
func (*ConcreteStructFormatter) CanFormat ¶
func (f *ConcreteStructFormatter) CanFormat(expr types.Type) bool
func (*ConcreteStructFormatter) Declaration ¶
func (f *ConcreteStructFormatter) Declaration(fieldName string, expr types.Type) string
func (*ConcreteStructFormatter) Deserialization ¶
func (f *ConcreteStructFormatter) Deserialization(expr *types.TypeName) string
func (*ConcreteStructFormatter) Name ¶
func (f *ConcreteStructFormatter) Name(expr *types.TypeName, includeTypeParams bool) string
func (*ConcreteStructFormatter) Serialization ¶
func (f *ConcreteStructFormatter) Serialization(expr *types.TypeName) string
type GenericStructFormatter ¶
type GenericStructFormatter struct {
TypeFormatterBase
}
func (*GenericStructFormatter) Annotation ¶
func (f *GenericStructFormatter) Annotation(expr *types.TypeName) string
func (*GenericStructFormatter) CanFormat ¶
func (f *GenericStructFormatter) CanFormat(expr types.Type) bool
func (*GenericStructFormatter) Declaration ¶
func (f *GenericStructFormatter) Declaration(fieldName string, expr types.Type) string
func (*GenericStructFormatter) Deserialization ¶
func (f *GenericStructFormatter) Deserialization(expr *types.TypeName) string
func (*GenericStructFormatter) Name ¶
func (f *GenericStructFormatter) Name(expr *types.TypeName, includeTypeParams bool) string
func (*GenericStructFormatter) Serialization ¶
func (f *GenericStructFormatter) Serialization(expr *types.TypeName) string
type MapFormatter ¶
type MapFormatter struct {
TypeFormatterBase
}
func (*MapFormatter) Declaration ¶
func (f *MapFormatter) Declaration(fieldName string, expr types.Type) string
func (*MapFormatter) DefaultValue ¶
func (f *MapFormatter) DefaultValue(expr types.Type) string
type PointerFormatter ¶
type PointerFormatter struct {
TypeFormatterBase
}
func (*PointerFormatter) Constructor ¶
func (f *PointerFormatter) Constructor(fieldName string, _ types.Type) string
func (*PointerFormatter) Declaration ¶
func (f *PointerFormatter) Declaration(fieldName string, expr types.Type) string
type PrimitiveFormatter ¶
type PrimitiveFormatter struct {
TypeFormatterBase
}
func (*PrimitiveFormatter) Declaration ¶
func (f *PrimitiveFormatter) Declaration(fieldName string, expr types.Type) string
type StructFormatter ¶
type TimeFormatter ¶
type TimeFormatter struct {
TypeFormatterBase
}
func (*TimeFormatter) Declaration ¶
func (f *TimeFormatter) Declaration(fieldName string, expr types.Type) string
type TypeFormatter ¶
type TypeFormatterBase ¶
type TypeFormatterBase struct { Registry *TypeFormatterRegistry Options options.Options }
func (*TypeFormatterBase) Constructor ¶
func (f *TypeFormatterBase) Constructor(fieldName string, _ types.Type) string
func (*TypeFormatterBase) DefaultValue ¶
func (t *TypeFormatterBase) DefaultValue(expr types.Type) string
func (*TypeFormatterBase) SetRegistry ¶
func (t *TypeFormatterBase) SetRegistry(registry *TypeFormatterRegistry)
type TypeFormatterRegistry ¶
type TypeFormatterRegistry struct { Formatters []TypeFormatter // contains filtered or unexported fields }
func NewTypeFormatterRegistry ¶
func NewTypeFormatterRegistry() *TypeFormatterRegistry
func (*TypeFormatterRegistry) AddKnownType ¶
func (t *TypeFormatterRegistry) AddKnownType(typ types.Type)
func (*TypeFormatterRegistry) GetTypeFormatter ¶
func (t *TypeFormatterRegistry) GetTypeFormatter(expr types.Type) TypeFormatter
func (*TypeFormatterRegistry) IsKnownNamedType ¶
func (t *TypeFormatterRegistry) IsKnownNamedType(namedType *types.Named) bool
func (*TypeFormatterRegistry) RegisterTypeFormatter ¶
func (t *TypeFormatterRegistry) RegisterTypeFormatter(formatter TypeFormatter)
type TypeParamsFormatter ¶
type TypeParamsFormatter struct {
TypeFormatterBase
}
func (*TypeParamsFormatter) CanFormat ¶
func (f *TypeParamsFormatter) CanFormat(expr types.Type) bool
func (*TypeParamsFormatter) Declaration ¶
func (f *TypeParamsFormatter) Declaration(fieldName string, expr types.Type) string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.