Documentation
¶
Overview ¶
Package generator provides tools to generate ObjectBox entity bindings between GO structs & ObjectBox schema
Index ¶
- Constants
- func BindingFile(sourceFile string) string
- func ModelFile(modelInfoFile string) string
- func ModelInfoFile(dir string) string
- func Process(sourceFile string, options Options) error
- type Annotation
- type Binding
- type Entity
- type Field
- type Identifier
- type Index
- type Options
- type Property
- type Relation
- type StandaloneRelation
Constants ¶
View Source
const Version = 2
Variables ¶
This section is empty.
Functions ¶
func BindingFile ¶
func ModelInfoFile ¶
Types ¶
type Annotation ¶
type Annotation struct {
Value string
}
type Entity ¶
type Entity struct {
Identifier
Name string
Fields []*Field // the tree of struct fields (necessary for embedded structs)
Properties []*Property
IdProperty *Property
LastPropertyId modelinfo.IdUid
Relations map[string]*StandaloneRelation
Annotations map[string]*Annotation
// contains filtered or unexported fields
}
func (*Entity) HasNonIdProperty ¶
called from the template avoid GO error "variable declared and not used"
func (*Entity) HasRelations ¶ added in v0.9.0
type Field ¶ added in v0.9.0
type Field struct {
Entity *Entity // parent entity
Name string
Type string
IsPointer bool
Property *Property // nil if it's an embedded struct
Fields []*Field // inner fields, nil if it's a property
SimpleRelation *Relation
StandaloneRelation *StandaloneRelation
}
func (*Field) HasRelations ¶ added in v0.9.0
type Identifier ¶ added in v0.9.0
type Identifier struct {
Id id
Uid uid
}
type Index ¶
type Index struct {
Identifier
}
type Property ¶
type Property struct {
Identifier
BaseName string // name in the containing struct (might be embedded)
Name string // prefixed name (unique)
ObName string // name of the field in DB
Annotations map[string]*Annotation
ObType string
ObFlags []string
GoType string
FbType string
Relation *Relation
Index *Index
Converter *string
// type casts for named types
CastOnRead string
CastOnWrite string
// contains filtered or unexported fields
}
func (*Property) FbvTableOffset ¶
calculates flatbuffers vTableOffset called from the template
type StandaloneRelation ¶ added in v0.9.0
type StandaloneRelation struct {
Identifier
Target struct {
Identifier
Name string
IsPointer bool
}
Name string
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.