Documentation
¶
Index ¶
- Variables
- type AliasType
- type ArrayType
- type Constant
- type CustomNameType
- type Decl
- type DurationType
- type Emitter
- func (e *Emitter) Bytes() []byte
- func (e *Emitter) Comment(s string)
- func (e *Emitter) Commentf(s string, args ...interface{})
- func (e *Emitter) Indent(n int32)
- func (e *Emitter) MaxLineLength() int32
- func (e *Emitter) Newline()
- func (e *Emitter) Printf(format string, args ...interface{})
- func (e *Emitter) Printlnf(format string, args ...interface{})
- func (e *Emitter) String() string
- type EmptyInterfaceType
- type File
- type Fragment
- type Import
- type MapType
- type Method
- type Named
- type NamedType
- type NullType
- type Package
- type PointerType
- type PrimitiveType
- type StructField
- type StructType
- type Type
- type TypeDecl
- type Var
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotGenerateCodegenPackageContentError = fmt.Errorf("cannot generate codegen.Package content")
Functions ¶
This section is empty.
Types ¶
type CustomNameType ¶
func (CustomNameType) Generate ¶
func (p CustomNameType) Generate(out *Emitter) error
func (CustomNameType) IsNillable ¶
func (p CustomNameType) IsNillable() bool
type DurationType ¶ added in v0.0.2
type DurationType struct{}
We need special handling when validating durations. Having a dedicated type for durations allows the validator to differentiate between durations and other types.
func (DurationType) Generate ¶ added in v0.0.2
func (t DurationType) Generate(out *Emitter) error
func (DurationType) GetName ¶ added in v0.0.2
func (t DurationType) GetName() string
func (DurationType) IsNillable ¶ added in v0.0.2
func (t DurationType) IsNillable() bool
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
func NewEmitter ¶
func (*Emitter) MaxLineLength ¶
type EmptyInterfaceType ¶
type EmptyInterfaceType struct{}
func (EmptyInterfaceType) Generate ¶
func (EmptyInterfaceType) Generate(out *Emitter) error
func (EmptyInterfaceType) IsNillable ¶
func (EmptyInterfaceType) IsNillable() bool
type NamedType ¶
func (NamedType) IsNillable ¶
type PointerType ¶
type PointerType struct {
Type Type
}
func (PointerType) Generate ¶
func (p PointerType) Generate(out *Emitter) error
func (PointerType) IsNillable ¶
func (PointerType) IsNillable() bool
type PrimitiveType ¶
type PrimitiveType struct {
Type string
}
func (PrimitiveType) Generate ¶
func (p PrimitiveType) Generate(out *Emitter) error
func (PrimitiveType) IsNillable ¶
func (PrimitiveType) IsNillable() bool
type StructField ¶
type StructField struct {
Name string
Type Type
Comment string
Tags string
JSONName string
DefaultValue interface{}
SchemaType *schemas.Type
}
func (*StructField) Generate ¶
func (f *StructField) Generate(out *Emitter) error
func (*StructField) GetName ¶
func (f *StructField) GetName() string
type StructType ¶
type StructType struct {
Fields []StructField
RequiredJSONFields []string
DefaultValue interface{}
}
func (*StructType) AddField ¶
func (s *StructType) AddField(f StructField)
func (*StructType) Generate ¶
func (s *StructType) Generate(out *Emitter) error
func (*StructType) IsNillable ¶
func (*StructType) IsNillable() bool
Click to show internal directories.
Click to hide internal directories.