generator

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package generator provides tools to generate ObjectBox entity bindings between GO structs & ObjectBox schema

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindingFile

func BindingFile(sourceFile string) string

func ModelFile

func ModelFile(modelInfoFile string) string

func ModelInfoFile

func ModelInfoFile(dir string) string

func Process

func Process(sourceFile, modelInfoFile string) error

Process is the main API method of the package it takes source file & model-information file paths and generates bindings (as a sibling file to the source file)

Types

type Annotation

type Annotation struct {
	Value string
}

type Binding

type Binding struct {
	Package  string
	Entities []*Entity
	// contains filtered or unexported fields
}

func (*Binding) UsesFbUtils

func (binding *Binding) UsesFbUtils() bool

called from the template avoid GO error "imported and not used"

type Entity

type Entity struct {
	Name           string
	Id             id
	Uid            uid
	Properties     []*Property
	IdProperty     *Property
	LastPropertyId modelinfo.IdUid
	// contains filtered or unexported fields
}

func (*Entity) HasNonIdProperty

func (entity *Entity) HasNonIdProperty() bool

called from the template avoid GO error "variable declared and not used"

type Index

type Index struct {
	Id  id
	Uid uid
}

type Property

type Property struct {
	Name        string
	ObName      string
	Id          id
	Uid         uid
	Annotations map[string]*Annotation
	ObType      string
	ObFlags     []string
	GoType      string
	FbType      string
	Relation    *Relation
	Index       *Index
	// contains filtered or unexported fields
}

func (*Property) FbSlot

func (property *Property) FbSlot() int

calculates flatbuffers slot number called from the template

func (*Property) FbvTableOffset

func (property *Property) FbvTableOffset() uint16

calculates flatbuffers vTableOffset called from the template

type Relation

type Relation struct {
	Target string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL