Documentation ¶
Index ¶
- func GetFieldName(f *types.Var) string
- func GetJSONFieldName(tag string, mode options.Mode) string
- type AliasFormatter
- func (f *AliasFormatter) CanFormat(expr types.Type) bool
- func (f *AliasFormatter) Constructor(fieldName string, expr types.Type) string
- func (f *AliasFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *AliasFormatter) DefaultValue(_ types.Type) string
- func (f *AliasFormatter) Signature(expr types.Type) string
- type ArrayFormatter
- func (f *ArrayFormatter) CanFormat(expr types.Type) bool
- func (f *ArrayFormatter) Constructor(fieldName string, _ types.Type) string
- func (f *ArrayFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *ArrayFormatter) DefaultValue(expr types.Type) string
- func (f *ArrayFormatter) Signature(expr types.Type) string
- type MapFormatter
- func (f *MapFormatter) CanFormat(expr types.Type) bool
- func (f *MapFormatter) Constructor(fieldName string, _ types.Type) string
- func (f *MapFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *MapFormatter) DefaultValue(expr types.Type) string
- func (f *MapFormatter) Signature(expr types.Type) string
- type PointerFormatter
- func (f *PointerFormatter) CanFormat(expr types.Type) bool
- func (f *PointerFormatter) Constructor(fieldName string, _ types.Type) string
- func (f *PointerFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *PointerFormatter) DefaultValue(_ types.Type) string
- func (f *PointerFormatter) Signature(expr types.Type) string
- type PrimitiveFormatter
- func (f *PrimitiveFormatter) CanFormat(expr types.Type) bool
- func (f *PrimitiveFormatter) Constructor(fieldName string, _ types.Type) string
- func (f *PrimitiveFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *PrimitiveFormatter) DefaultValue(_ types.Type) string
- func (f *PrimitiveFormatter) Signature(expr types.Type) string
- type StructFormatter
- func (f *StructFormatter) CanFormat(expr types.Type) bool
- func (f *StructFormatter) Constructor(fieldName string, _ types.Type) string
- func (f *StructFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *StructFormatter) DefaultValue(_ types.Type) string
- func (f *StructFormatter) Signature(expr types.Type) string
- type TimeFormatter
- func (f *TimeFormatter) CanFormat(expr types.Type) bool
- func (f *TimeFormatter) Constructor(fieldName string, _ types.Type) string
- func (f *TimeFormatter) Declaration(fieldName string, expr types.Type) string
- func (f *TimeFormatter) DefaultValue(_ types.Type) string
- func (f *TimeFormatter) Signature(_ types.Type) string
- type TypeFormatter
- type TypeFormatterBase
- type TypeFormatterRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
func (*AliasFormatter) DefaultValue ¶
func (f *AliasFormatter) DefaultValue(_ types.Type) string
type ArrayFormatter ¶
type ArrayFormatter struct {
TypeFormatterBase
}
func (*ArrayFormatter) Constructor ¶
func (f *ArrayFormatter) Constructor(fieldName string, _ types.Type) string
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 MapFormatter ¶
type MapFormatter struct {
TypeFormatterBase
}
func (*MapFormatter) Constructor ¶
func (f *MapFormatter) Constructor(fieldName string, _ types.Type) string
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
func (*PointerFormatter) DefaultValue ¶
func (f *PointerFormatter) DefaultValue(_ types.Type) string
type PrimitiveFormatter ¶
type PrimitiveFormatter struct {
TypeFormatterBase
}
func (*PrimitiveFormatter) Constructor ¶
func (f *PrimitiveFormatter) Constructor(fieldName string, _ types.Type) string
func (*PrimitiveFormatter) Declaration ¶
func (f *PrimitiveFormatter) Declaration(fieldName string, expr types.Type) string
func (*PrimitiveFormatter) DefaultValue ¶
func (f *PrimitiveFormatter) DefaultValue(_ types.Type) string
type StructFormatter ¶
type StructFormatter struct {
TypeFormatterBase
}
func (*StructFormatter) Constructor ¶
func (f *StructFormatter) Constructor(fieldName string, _ types.Type) string
func (*StructFormatter) Declaration ¶
func (f *StructFormatter) Declaration(fieldName string, expr types.Type) string
func (*StructFormatter) DefaultValue ¶
func (f *StructFormatter) DefaultValue(_ types.Type) string
type TimeFormatter ¶
type TimeFormatter struct {
TypeFormatterBase
}
func (*TimeFormatter) Constructor ¶
func (f *TimeFormatter) Constructor(fieldName string, _ types.Type) string
func (*TimeFormatter) Declaration ¶
func (f *TimeFormatter) Declaration(fieldName string, expr types.Type) string
func (*TimeFormatter) DefaultValue ¶
func (f *TimeFormatter) DefaultValue(_ types.Type) string
type TypeFormatter ¶
type TypeFormatterBase ¶
type TypeFormatterBase struct { Registry *TypeFormatterRegistry Mode options.Mode }
func (*TypeFormatterBase) SetRegistry ¶
func (t *TypeFormatterBase) SetRegistry(registry *TypeFormatterRegistry)
type TypeFormatterRegistry ¶
type TypeFormatterRegistry struct { KnownTypes map[types.Type]struct{} Formatters []TypeFormatter }
func NewTypeFormatterRegistry ¶
func NewTypeFormatterRegistry() *TypeFormatterRegistry
func (*TypeFormatterRegistry) GetTypeFormatter ¶
func (t *TypeFormatterRegistry) GetTypeFormatter(expr types.Type) TypeFormatter
func (*TypeFormatterRegistry) RegisterTypeFormatter ¶
func (t *TypeFormatterRegistry) RegisterTypeFormatter(formatter TypeFormatter)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.