Documentation
¶
Index ¶
- func JSONEncoder(writer io.Writer, v interface{}) error
- func NewErrors(inErrors ...error) error
- func YAMLEncoder(writer io.Writer, v interface{}) error
- type Errors
- type Field
- type Mapper
- type Mappers
- type MappersFactory
- type Schema
- type SchemaCollection
- type Schemas
- func (s *Schemas) AddMapper(schemaID string, mapper Mapper) *Schemas
- func (s *Schemas) AddMapperForType(obj interface{}, mapper ...Mapper) *Schemas
- func (s *Schemas) AddSchema(schema Schema) *Schemas
- func (s *Schemas) AddSchemas(schema *Schemas) *Schemas
- func (s *Schemas) Err() error
- func (s *Schemas) Import(obj interface{}, overrides ...interface{}) (*Schema, error)
- func (s *Schemas) Init(initFunc SchemasInitFunc) *Schemas
- func (s *Schemas) MustImport(obj interface{}, overrides ...interface{}) *Schemas
- func (s *Schemas) RemoveSchema(schema Schema) *Schemas
- func (s *Schemas) Schema(name string) *Schema
- func (s *Schemas) Schemas() map[string]*Schema
- func (s *Schemas) TypeName(name string, obj interface{}) *Schemas
- type SchemasInitFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONEncoder ¶
func YAMLEncoder ¶
Types ¶
type Field ¶
type Field struct {
Type string `json:"type,omitempty"`
Default interface{} `json:"default,omitempty"`
Nullable bool `json:"nullable,omitempty"`
Create bool `json:"create"`
WriteOnly bool `json:"writeOnly,omitempty"`
Required bool `json:"required,omitempty"`
Update bool `json:"update"`
MinLength *int64 `json:"minLength,omitempty"`
MaxLength *int64 `json:"maxLength,omitempty"`
Min *int64 `json:"min,omitempty"`
Max *int64 `json:"max,omitempty"`
Options []string `json:"options,omitempty"`
ValidChars string `json:"validChars,omitempty"`
InvalidChars string `json:"invalidChars,omitempty"`
Description string `json:"description,omitempty"`
CodeName string `json:"-"`
DynamicField bool `json:"dynamicField,omitempty"`
}
type MappersFactory ¶
type MappersFactory func() []Mapper
type Schema ¶
type Schema struct {
ID string `json:"id,omitempty"`
CodeName string `json:"-"`
CodeNamePlural string `json:"-"`
PkgName string `json:"-"`
Type string `json:"type,omitempty"`
Links map[string]string `json:"links"`
PluralName string `json:"pluralName,omitempty"`
ResourceFields map[string]Field `json:"resourceFields"`
NonNamespaced bool `json:"-"`
Object bool `json:"-"`
InternalSchema *Schema `json:"-"`
Mapper Mapper `json:"-"`
}
type SchemaCollection ¶
type SchemaCollection struct {
Data []Schema
}
type Schemas ¶
type Schemas struct {
sync.Mutex
DefaultMappers MappersFactory
DefaultPostMappers MappersFactory
// contains filtered or unexported fields
}
func NewSchemas ¶
func NewSchemas() *Schemas
func (*Schemas) AddMapperForType ¶
func (*Schemas) AddSchemas ¶
func (*Schemas) Init ¶
func (s *Schemas) Init(initFunc SchemasInitFunc) *Schemas
func (*Schemas) MustImport ¶
func (*Schemas) RemoveSchema ¶
type SchemasInitFunc ¶
Click to show internal directories.
Click to hide internal directories.