Documentation ¶
Index ¶
- func Connect(driverName string, connString string, show bool) (eng *xorm.Engine, err error)
- func ConnectRequestDB(request string) (eng *xorm.Engine, err error)
- func Drop(db DB, ent interface{}) (err error)
- func DropAll(db DB) (err error)
- func ExportData(db DB, request string) (response string, err error)
- func ExportMeta(db DB, request string) (response string, err error)
- func ImportData(db DB, request string, meta *Meta) (response string, err error)
- func ImportMeta(db DB, request string, meta *Meta) (response string, err error)
- func InsertOrUpdateLink(db DB, objMap map[string]interface{}, meta *Meta) (response string, err error)
- func InsertOrUpdateObject(db DB, objMap map[string]interface{}, meta *Meta) (response string, err error)
- func LinkObjectsInsertOrUpdate(db DB, relTraits *RelationTraits, objectFrom *Object, objectTo *Object, ...) (affected int64, inserted bool, err error)
- func Run(request string, meta *Meta, db DB) (response string, err error)
- func RunBatch(request string, meta *Meta, db DB) (response string, err error)
- func RunExport(service string, request string, meta *Meta, db DB) (response string, err error)
- func RunImport(service string, request string, meta *Meta, db DB) (response string, err error)
- func RunInsert(service string, request string, meta *Meta, db DB) (response string, err error)
- func RunOne(request string, meta *Meta, db DB) (response string, err error)
- func RunSelect(service string, request string, meta *Meta, db DB) (response string, err error)
- func RunSystem(service string, request string, meta *Meta, db DB) (response string, err error)
- func SelectObject(db DB, objMap map[string]interface{}, meta *Meta) (response string, err error)
- func Sync(db DB, ent interface{}) error
- func SyncAll(db DB) (err error)
- func SystemUpload(db DB, request string) (response string, err error)
- func TraitObjectInsertOrUpdate(db DB, trait *Trait, object *Object, meta *Meta) (affected int64, inserted bool, err error)
- type DB
- type Document
- type File
- type Ledger
- type LinkObjects
- func (link *LinkObjects) Get(db DB) (has bool, err error)
- func (link *LinkObjects) Insert(db DB) (affected int64, err error)
- func (link *LinkObjects) InsertOrUpdate(db DB, find *LinkObjects) (affected int64, inserted bool, err error)
- func (link *LinkObjects) Update(db DB) (affected int64, err error)
- type Meta
- func (meta *Meta) AddRelTraits(relTraits *RelationTraits) (err error)
- func (meta *Meta) AddRelation(relation *Relation)
- func (meta *Meta) AddTrait(trait *Trait)
- func (meta *Meta) LoadRelTraits(db DB) (err error)
- func (meta *Meta) LoadRelations(db DB) (err error)
- func (meta *Meta) LoadTraits(db DB) (err error)
- type Object
- func (object *Object) AddTrait(eng *xorm.Engine, trait *Trait, meta *Meta) (affected int64, err error)
- func (object *Object) Get(db DB) (has bool, err error)
- func (object *Object) Insert(db DB) (affected int64, err error)
- func (object *Object) InsertOrUpdate(db DB, find *Object) (affected int64, inserted bool, err error)
- func (object *Object) Update(db DB) (affected int64, err error)
- type Relation
- func (relation *Relation) AddRelationTraits(db DB, traitFrom *Trait, traitTo *Trait, props map[string]interface{}, ...) (affected int64, inserted bool, err error)
- func (relation *Relation) Get(db DB) (has bool, err error)
- func (relation *Relation) Insert(db DB) (affected int64, err error)
- func (relation *Relation) InsertOrUpdate(db DB, find *Relation) (affected int64, inserted bool, err error)
- func (relation *Relation) Update(db DB) (affected int64, err error)
- type RelationTraits
- type RelationTraitsKey
- type Service
- type Trait
- func (trait *Trait) AddObject(db DB, object *Object, meta *Meta) (affected int64, inserted bool, err error)
- func (trait *Trait) AddRelationFrom(db DB, relation *Relation, traitFrom *Trait, props map[string]interface{}, ...) (affected int64, err error)
- func (trait *Trait) AddRelationTo(db DB, relation *Relation, traitTo *Trait, props map[string]interface{}, ...) (affected int64, err error)
- func (trait *Trait) Get(db DB) (has bool, err error)
- func (trait *Trait) Insert(db DB) (affected int64, err error)
- func (trait *Trait) InsertOrUpdate(db DB, find *Trait) (affected int64, inserted bool, err error)
- func (trait *Trait) Update(db DB) (affected int64, err error)
- func (trait *Trait) UpdateObjectProps(db DB, object *Object, props map[string]interface{}) (affected int64, err error)
- type TraitObject
- type TypeDocument
- func (typedoc *TypeDocument) Get(db DB) (has bool, err error)
- func (typedoc *TypeDocument) Insert(db DB) (affected int64, err error)
- func (typedoc *TypeDocument) InsertOrUpdate(db DB, find *TypeDocument) (affected int64, inserted bool, err error)
- func (typedoc *TypeDocument) Update(db DB) (affected int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectRequestDB ¶
ConnectRequestDB -
func ImportData ¶
ImportData -
func ImportMeta ¶
ImportMeta -
func InsertOrUpdateLink ¶
func InsertOrUpdateLink(db DB, objMap map[string]interface{}, meta *Meta) (response string, err error)
InsertOrUpdateLink -
func InsertOrUpdateObject ¶
func InsertOrUpdateObject(db DB, objMap map[string]interface{}, meta *Meta) (response string, err error)
InsertOrUpdateObject -
func LinkObjectsInsertOrUpdate ¶
func LinkObjectsInsertOrUpdate(db DB, relTraits *RelationTraits, objectFrom *Object, objectTo *Object, props map[string]interface{}) (affected int64, inserted bool, err error)
LinkObjectsInsertOrUpdate -
func SelectObject ¶
SelectObject -
func SystemUpload ¶
SystemUpload -
Types ¶
type DB ¶
type DB interface { Insert(beans ...interface{}) (affected int64, err error) Get(bean interface{}) (has bool, err error) Find(rowsSlicePtr interface{}, condiBean ...interface{}) error Update(bean interface{}, condiBean ...interface{}) (affected int64, err error) ID(id interface{}) *xorm.Session Where(query interface{}, args ...interface{}) *xorm.Session Sync2(beans ...interface{}) error }
DB -
type Document ¶
type Document struct { ID int64 Dt time.Time `xorm:"notnull index"` UUID string `xorm:"varchar(36) notnull unique"` DocTypeID int64 `xorm:"notnull index"` DebID int64 `xorm:"notnull index"` CredID int64 `xorm:"notnull index"` Props map[string]interface{} `xorm:"jsonb"` Status int `xorm:"notnull index"` Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` }
Document -
func ImportFromService ¶
ImportFromService -
func NewDocument ¶
NewDocument -
func (*Document) FillDocument ¶
FillDocument -
type File ¶
type File struct { ID int64 UUID string `xorm:"varchar(36) notnull unique"` Name string `xorm:"varchar(1024) notnull unique"` Props map[string]interface{} `xorm:"jsonb"` Content []byte `xorm:"bytea"` Status int `xorm:"notnull index"` Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` }
File -
func (*File) InsertOrUpdate ¶
InsertOrUpdate -
type Ledger ¶
type Ledger struct { ID int64 Dt time.Time `xorm:"notnull index"` DocID int64 `xorm:"notnull index"` DebID int64 `xorm:"notnull index"` CredID int64 `xorm:"notnull index"` Amount int64 `xorm:"notnull"` Props map[string]interface{} `xorm:"jsonb"` Status int `xorm:"notnull index"` Created time.Time `xorm:"created"` }
Ledger -
type LinkObjects ¶
type LinkObjects struct { ID int64 `json:"-"` RelationTraitsID int64 `xorm:"notnull unique(relation_traits_link_objects)" json:"-"` RelationName string `xorm:"-" json:"relation"` TraitFromName string `xorm:"-" json:"trait-from"` ObjectFromID int64 `xorm:"notnull unique(relation_traits_link_objects)" json:"-"` ObjectFromName string `xorm:"-" json:"object-from"` TraitToName string `xorm:"-" json:"trait-to"` ObjectToID int64 `xorm:"notnull unique(relation_traits_link_objects)" json:"-"` ObjectToName string `xorm:"-" json:"object-to"` Props map[string]interface{} `xorm:"jsonb" json:"props"` Hash string `xorm:"text" json:"hash"` Status int `xorm:"notnull index" json:"-"` Created time.Time `xorm:"created" json:"-"` Updated time.Time `xorm:"updated" json:"-"` }
LinkObjects -
func (*LinkObjects) Insert ¶
func (link *LinkObjects) Insert(db DB) (affected int64, err error)
Insert -
func (*LinkObjects) InsertOrUpdate ¶
func (link *LinkObjects) InsertOrUpdate(db DB, find *LinkObjects) (affected int64, inserted bool, err error)
InsertOrUpdate -
type Meta ¶
type Meta struct { TraitsByName map[string]*Trait TraitsByID map[int64]*Trait RelationsByName map[string]*Relation RelationsByID map[int64]*Relation RelTraitsByName map[RelationTraitsKey]*RelationTraits RelTraitsByID map[int64]*RelationTraits TypeDocsByName map[string]*TypeDocument TypeDocsByID map[int64]*TypeDocument }
Meta -
func (*Meta) AddRelTraits ¶
func (meta *Meta) AddRelTraits(relTraits *RelationTraits) (err error)
AddRelTraits -
type Object ¶
type Object struct { ID int64 `json:"-"` UUID string `xorm:"varchar(36) notnull unique" json:"uuid"` Name string `xorm:"varchar(1024) notnull unique" json:"name"` Props map[string]interface{} `xorm:"jsonb" json:"props"` Hash string `xorm:"text" json:"hash"` Status int `xorm:"notnull index" json:"status"` Created time.Time `xorm:"created" json:"-"` Updated time.Time `xorm:"updated" json:"-"` }
Object -
func (*Object) AddTrait ¶
func (object *Object) AddTrait(eng *xorm.Engine, trait *Trait, meta *Meta) (affected int64, err error)
AddTrait -
type Relation ¶
type Relation struct { ID int64 `json:"-"` UUID string `xorm:"varchar(36) notnull unique" json:"uuid"` Name string `xorm:"varchar(1024) notnull unique" json:"name"` Props map[string]interface{} `xorm:"jsonb" json:"props"` Status int `xorm:"notnull index" json:"-"` Created time.Time `xorm:"created" json:"-"` Updated time.Time `xorm:"updated" json:"-"` }
Relation -
func NewRelation ¶
func NewRelation(name string, props map[string]interface{}, lib string) (relation *Relation, err error)
NewRelation -
func (*Relation) AddRelationTraits ¶
func (relation *Relation) AddRelationTraits(db DB, traitFrom *Trait, traitTo *Trait, props map[string]interface{}, lib string) (affected int64, inserted bool, err error)
AddRelationTraits -
type RelationTraits ¶
type RelationTraits struct { ID int64 `json:"-"` RelationID int64 `xorm:"notnull unique(relation_traits)" json:"-"` RelationName string `xorm:"-" json:"relation"` TraitFromID int64 `xorm:"notnull unique(relation_traits)" json:"-"` TraitFromName string `xorm:"-" json:"trait-from"` TraitToID int64 `xorm:"notnull unique(relation_traits)" json:"-"` TraitToName string `xorm:"-" json:"trait-to"` Props map[string]interface{} `xorm:"jsonb" json:"props"` Lib string `xorm:"text" json:"lib"` LibContent string `xorm:"-" json:"-"` Status int `xorm:"notnull index" json:"-"` Created time.Time `xorm:"created" json:"-"` Updated time.Time `xorm:"updated" json:"-"` }
RelationTraits -
func (*RelationTraits) AddLinkObjects ¶
func (relTraits *RelationTraits) AddLinkObjects(db DB, objectFrom *Object, objectTo *Object, props map[string]interface{}) (affected int64, inserted bool, err error)
AddLinkObjects -
type RelationTraitsKey ¶
RelationTraitsKey -
type Service ¶
type Service struct { ID int64 UUID string `xorm:"varchar(36) notnull unique"` Name string `xorm:"varchar(1024) notnull unique"` Props map[string]interface{} `xorm:"jsonb"` Lib string `xorm:"text"` Status int `xorm:"notnull index"` Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` }
Service -
func NewService ¶
func NewService(name string, props map[string]interface{}, lib string) (service *Service, err error)
NewService -
type Trait ¶
type Trait struct { ID int64 `json:"-"` UUID string `xorm:"varchar(36) notnull unique" json:"uuid"` Name string `xorm:"varchar(1024) notnull unique" json:"name"` Props map[string]interface{} `xorm:"jsonb" json:"props"` Lib string `xorm:"text" json:"lib"` LibContent string `xorm:"-" json:"-"` Status int `xorm:"notnull index" json:"-"` Created time.Time `xorm:"created" json:"-"` Updated time.Time `xorm:"updated" json:"-"` }
Trait -
func (*Trait) AddObject ¶
func (trait *Trait) AddObject(db DB, object *Object, meta *Meta) (affected int64, inserted bool, err error)
AddObject -
func (*Trait) AddRelationFrom ¶
func (trait *Trait) AddRelationFrom(db DB, relation *Relation, traitFrom *Trait, props map[string]interface{}, lib string) (affected int64, err error)
AddRelationFrom -
func (*Trait) AddRelationTo ¶
func (trait *Trait) AddRelationTo(db DB, relation *Relation, traitTo *Trait, props map[string]interface{}, lib string) (affected int64, err error)
AddRelationTo -
func (*Trait) InsertOrUpdate ¶
InsertOrUpdate -
type TraitObject ¶
type TraitObject struct { ID int64 `json:"-"` TraitID int64 `xorm:"notnull unique(trait_object)" json:"-"` TraitName string `xorm:"-" json:"trait-name"` ObjectID int64 `xorm:"notnull unique(trait_object)" json:"-"` ObjectName string `xorm:"-" json:"object-name"` Props map[string]interface{} `xorm:"jsonb" json:"props"` Hash string `xorm:"text" json:"hash"` Status int `xorm:"notnull index" json:"-"` Created time.Time `xorm:"created" json:"-"` Updated time.Time `xorm:"updated" json:"-"` }
TraitObject -
type TypeDocument ¶
type TypeDocument struct { ID int64 UUID string `xorm:"varchar(36) notnull unique"` Name string `xorm:"varchar(1024) notnull unique"` DebTraitID int64 `xorm:"notnull index"` DebTraitName string `xorm:"-" json:"deb-trait"` CredTraitID int64 `xorm:"notnull index"` CredTraitName string `xorm:"-" json:"cred-trait"` Props map[string]interface{} `xorm:"jsonb"` Lib string `xorm:"text"` Status int `xorm:"notnull index"` Created time.Time `xorm:"created"` Updated time.Time `xorm:"updated"` }
TypeDocument -
func NewTypeDocument ¶
func NewTypeDocument(name string, debTraitID int64, credTraitID int64, props map[string]interface{}, lib string) (typedoc *TypeDocument, err error)
NewTypeDocument -
func (*TypeDocument) Insert ¶
func (typedoc *TypeDocument) Insert(db DB) (affected int64, err error)
Insert -
func (*TypeDocument) InsertOrUpdate ¶
func (typedoc *TypeDocument) InsertOrUpdate(db DB, find *TypeDocument) (affected int64, inserted bool, err error)
InsertOrUpdate -
Click to show internal directories.
Click to hide internal directories.