Documentation ¶
Index ¶
- func AllModelers() (ret []string)
- func RegisterModeler(name string, m Modeler)
- func Run(schema *Schema, config *Config) error
- type Array
- type Boolean
- type Bytes
- type Client
- type Config
- type Double
- type Enum
- type File
- type GeoPoint
- type Integer
- type Language
- type Map
- type Modeler
- type Reference
- type Schema
- type SchemaEnum
- type SchemaEnumValue
- type SchemaField
- type SchemaFieldType
- type SchemaModel
- type SchemaModelOptions
- func (options SchemaModelOptions) Get(key string) map[string]string
- func (options SchemaModelOptions) GetAutoTimestamp() bool
- func (options SchemaModelOptions) GetFirestoreModelName() (modelName string, err error)
- func (options SchemaModelOptions) GetFirestorePath() (format string, args []string, err error)
- type SchemaNestedCollection
- type SchemaOptions
- type SchemaStruct
- type SourceCoder
- type String
- type Struct
- type Timestamp
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllModelers ¶
func AllModelers() (ret []string)
func RegisterModeler ¶
Types ¶
type Array ¶
type Array struct{ T SchemaFieldType }
type Config ¶
type Config struct { Languages []Language SourceCoderProvider func(prefix string) SourceCoder }
type Enum ¶
type Enum struct{ T *SchemaEnum }
type Map ¶
type Map struct{ T SchemaFieldType }
type Modeler ¶
type Modeler interface {
Model(schema *Schema, sourceCoder SourceCoder) error
}
type Reference ¶
type Reference struct{ T *SchemaModel }
type Schema ¶
type Schema struct { Models []*SchemaModel Enums []*SchemaEnum Structs []*SchemaStruct Options SchemaOptions }
type SchemaEnum ¶
type SchemaEnum struct { Name string Comment string Values []*SchemaEnumValue }
type SchemaEnumValue ¶
type SchemaField ¶
type SchemaField struct { Name string Comment string Type SchemaFieldType }
type SchemaFieldType ¶
type SchemaFieldType interface {
// contains filtered or unexported methods
}
type SchemaModel ¶
type SchemaModel struct { Name string Comment string Fields []*SchemaField Collections []*SchemaNestedCollection Options SchemaModelOptions }
type SchemaModelOptions ¶
type SchemaModelOptions SchemaOptions
func (SchemaModelOptions) GetAutoTimestamp ¶
func (options SchemaModelOptions) GetAutoTimestamp() bool
func (SchemaModelOptions) GetFirestoreModelName ¶ added in v0.0.18
func (options SchemaModelOptions) GetFirestoreModelName() (modelName string, err error)
func (SchemaModelOptions) GetFirestorePath ¶
func (options SchemaModelOptions) GetFirestorePath() (format string, args []string, err error)
GetFirestorePath returns the templatized Firestore path where this model is located in Firestore.
This method requires that the model includes an option called firestore.path.
The path may include variables, wrapped in curly brackets: e.g. `users/{user_id}`. Variables are replaced with %s, so that they can be interpolated by printf functions. vars provides the names of these interpolation variables.
type SchemaNestedCollection ¶
type SchemaNestedCollection struct { Name string Comment string Type *SchemaModel }
type SchemaOptions ¶
type SchemaStruct ¶ added in v0.0.5
type SchemaStruct struct { Name string Comment string Fields []*SchemaField }
type SourceCoder ¶
type SourceCoder interface { NewFile(filename string) (io.WriteCloser, error) Flush() error }
type Struct ¶ added in v0.0.5
type Struct struct{ T *SchemaStruct }
Click to show internal directories.
Click to hide internal directories.