Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedFormat = fmt.Errorf("unsupported format. supported formats are: JSON, TypeScripts, Go, Java") ErrEmptyObjectName = fmt.Errorf("object name should be non-zero length") )
View Source
var ErrUnsupportedType = fmt.Errorf("unsupported type")
Functions ¶
Types ¶
type Collection ¶
type Field ¶
type Field struct { Type string `json:"type,omitempty"` Format string `json:"format,omitempty"` Tags []string `json:"tags,omitempty"` Desc string `json:"description,omitempty"` Fields map[string]*Field `json:"properties,omitempty"` Items *Field `json:"items,omitempty"` Default any `json:"default,omitempty"` MaxLength int `json:"maxLength,omitempty"` CreatedAt bool `json:"createdAt,omitempty"` UpdatedAt bool `json:"updatedAt,omitempty"` AutoGenerate bool `json:"autoGenerate,omitempty"` Required []string `json:"required,omitempty"` SearchIndex bool `json:"searchIndex,omitempty"` Facet bool `json:"facet,omitempty"` Sort bool `json:"sort,omitempty"` // RequiredTag is used during schema building only RequiredTag bool `json:"-"` }
Field represents JSON schema object.
type FieldGen ¶
type FieldGen struct { Type string TypeDecap string Name string NameDecap string NameSnake string NameJSON string NamePlural string JSONCap string IsArray bool IsObject bool AutoGenerate bool PrimaryKeyIdx int ArrayDimensions int Default any DefaultStr string DefaultStrSingleQuotes string MaxLength int UpdatedAt bool CreatedAt bool Required bool SearchIndex bool Facet bool Sort bool Description string }
type JSONToJava ¶
type JSONToJava struct{}
func (*JSONToJava) GetObjectTemplate ¶
func (*JSONToJava) GetObjectTemplate() string
type JSONToLangType ¶
type JSONToTypeScript ¶
type JSONToTypeScript struct{}
func (*JSONToTypeScript) GetObjectTemplate ¶
func (*JSONToTypeScript) GetObjectTemplate() string
type Schema ¶
type Schema struct { Name string `json:"title,omitempty"` Desc string `json:"description,omitempty"` Fields map[string]*Field `json:"properties,omitempty"` PrimaryKey []string `json:"primary_key,omitempty"` Required []string `json:"required,omitempty"` CollectionType string `json:"collection_type,omitempty"` }
Schema is top level JSON schema object.
Click to show internal directories.
Click to hide internal directories.