Documentation ¶
Index ¶
- Constants
- func FormatDoc(str string) string
- func GenerateOpenApi(p *Parser, s IType) spec.Schema
- func PrintSwagger(p *Parser) spec.Swagger
- func PrintTsTypes(parser *Parser, w io.Writer, stringify Stringifier)
- type BaseType
- type EnumDef
- type EnumValue
- type Fn
- type IType
- type Package
- type ParseResult
- type Parser
- type PkgParseResult
- type PropertyState
- type RawType
- type RecordDef
- type RecordField
- type Stringifier
- type TypeDef
- type TypeToString
Constants ¶
View Source
const GlobalTemplate = `` /* 313-byte string literal not displayed */
View Source
const RecordTemplate = `` /* 173-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func PrintSwagger ¶
func PrintTsTypes ¶
func PrintTsTypes(parser *Parser, w io.Writer, stringify Stringifier)
Types ¶
type BaseType ¶
func (*BaseType) GetPackage ¶
type ParseResult ¶
type ParseResult struct { FieldName string FieldType string State PropertyState }
func ParseStructTag ¶
func ParseStructTag(structTag reflect.StructTag) (*ParseResult, error)
type Parser ¶
type Parser struct { // You can skip field or replace it with another type CustomParse func(arg reflect.Type) (IType, bool) // contains filtered or unexported fields }
func NewFromTypes ¶
func NewFromTypes(types ...interface{}) *Parser
type PkgParseResult ¶
func GetPackages ¶
func GetPackages(pkgName string) (*PkgParseResult, error)
type PropertyState ¶
type PropertyState int
const ( Auto PropertyState = iota Ignored Optional Null NotNull )
type RecordField ¶
func (*RecordField) IsType ¶
func (*RecordField) IsType()
type Stringifier ¶
type TypeToString ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.