database

package
v0.0.0-...-6c5c415 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OFF = iota
	ERROR
	WARN
	INFO
	DEBUG
	DEEPDEBUG
)

Variables

View Source
var BOOL = 5
View Source
var EMBED = 6
View Source
var FLOAT = 4
View Source
var INTEGER = 3
View Source
var LIST = 7
View Source
var LOCALID = 2
View Source
var NULL = 8
View Source
var STRING = 1

Type codes

Functions

func ListToInterfaceList

func ListToInterfaceList(value interface{}) (result []interface{}, err error)

func TypesToValue

func TypesToValue(typeCode int, vStr string, vInt int64, vFloat float64, vBool bool) (value interface{}, err error)

func ValueToTypes

func ValueToTypes(value interface{}) (typeCode int, vStr string, vInt int64, vFloat float64, vBool bool, err error)

Converts a value from an object into a type code and the set of variables needed by the datebase

Types

type DBTx

type DBTx struct {
	DebugLevel int
	// contains filtered or unexported fields
}

func (*DBTx) AddField

func (t *DBTx) AddField(objectID object.LocalID, fieldName string, data interface{}) (err error)

func (*DBTx) BasicObjectData

func (t *DBTx) BasicObjectData(objectID object.LocalID) (objType string, owner object.LocalID, err error)

func (*DBTx) DeleteAccount

func (t *DBTx) DeleteAccount(user string) (err error)

func (*DBTx) EndTransaction

func (t *DBTx) EndTransaction(errIn *error) (err error)

func (*DBTx) Exists

func (t *DBTx) Exists(objectID object.LocalID) (exists bool, err error)

func (*DBTx) GetPropIDs

func (t *DBTx) GetPropIDs() (propQueue []object.LocalID, err error)

func (*DBTx) GetPropObject

func (t *DBTx) GetPropObject(objectID object.LocalID) (obj map[string]interface{}, err error)

func (*DBTx) GetPropTargets

func (t *DBTx) GetPropTargets(objectID object.LocalID) (queue []goap.PropRetryTarget, err error)

func (*DBTx) IsProtected

func (t *DBTx) IsProtected(objectID object.LocalID) (protected bool, err error)

func (*DBTx) ListAppend

func (t *DBTx) ListAppend(objectID object.LocalID, fieldName string, data interface{}) (err error)

func (*DBTx) ListRemove

func (t *DBTx) ListRemove(objectID object.LocalID, fieldName string, value interface{}) (err error)

func (*DBTx) LoadAccount

func (t *DBTx) LoadAccount(user string) (acct goap.Account, err error)

func (*DBTx) LoadCache

func (t *DBTx) LoadCache(objectID string) (obj map[string]interface{}, err error)

func (*DBTx) LoadChangeset

func (t *DBTx) LoadChangeset(changeID string) (set []goap.Change, err error)

func (*DBTx) LoadObject

func (t *DBTx) LoadObject(objectID object.LocalID) (obj map[string]interface{}, err error)

func (*DBTx) LoadObjectField

func (t *DBTx) LoadObjectField(objectID object.LocalID, fieldName string) (value interface{}, err error)

func (*DBTx) ObjcolAdd

func (t *DBTx) ObjcolAdd(objectID object.LocalID, fieldName string, value interface{}) (err error)

func (*DBTx) ObjcolGetAll

func (t *DBTx) ObjcolGetAll(objectID object.LocalID) (data map[string][]interface{}, err error)

func (*DBTx) ObjcolGetAllField

func (t *DBTx) ObjcolGetAllField(objectID object.LocalID, fieldName string) (values []interface{}, err error)

func (*DBTx) ObjcolGetFields

func (t *DBTx) ObjcolGetFields(objectID object.LocalID) (fields []string, err error)

func (*DBTx) ObjcolRM

func (t *DBTx) ObjcolRM(objectID object.LocalID, fieldName string, value interface{}) (err error)

func (*DBTx) ObjcolRMAll

func (t *DBTx) ObjcolRMAll(objectID object.LocalID) (err error)

func (*DBTx) ObjcolSet

func (t *DBTx) ObjcolSet(objectID object.LocalID, data map[string][]interface{}) (err error)

func (*DBTx) RemoveField

func (t *DBTx) RemoveField(objectID object.LocalID, fieldName string) (err error)

func (*DBTx) RemoveObject

func (t *DBTx) RemoveObject(objectID object.LocalID) (err error)

func (*DBTx) RemovePropTarget

func (t *DBTx) RemovePropTarget(objectID object.LocalID, targetURL string) (err error)

func (*DBTx) RevertTransaction

func (t *DBTx) RevertTransaction() (err error)

func (*DBTx) SetProtected

func (t *DBTx) SetProtected(objectID object.LocalID, protected bool) (err error)

func (*DBTx) StoreAccount

func (t *DBTx) StoreAccount(acct goap.Account) (err error)

func (*DBTx) StoreCache

func (t *DBTx) StoreCache(obj map[string]interface{}) (err error)

func (*DBTx) StoreChangeset

func (t *DBTx) StoreChangeset(changeID string, changeset []goap.Change) (err error)

func (*DBTx) StoreObject

func (t *DBTx) StoreObject(obj map[string]interface{}) (err error)

func (*DBTx) StoreProp

func (t *DBTx) StoreProp(obj map[string]interface{}, targets []goap.PropRetryTarget) (err error)

func (*DBTx) UpdateAccount

func (t *DBTx) UpdateAccount(user string, acct goap.Account) (err error)

func (*DBTx) UpdateField

func (t *DBTx) UpdateField(objectID object.LocalID, fieldName string, data interface{}) (err error)

func (*DBTx) UpdatePropTarget

func (t *DBTx) UpdatePropTarget(objectID object.LocalID, target goap.PropRetryTarget) (err error)

func (*DBTx) ValueInObject

func (t *DBTx) ValueInObject(objectID object.LocalID, fieldName string, data interface{}) (found bool, err error)

type Database

type Database struct {
	DebugLevel int
	// contains filtered or unexported fields
}

func OpenDatabase

func OpenDatabase(filename string) (db *Database, err error)

func (*Database) Close

func (d *Database) Close() (err error)

func (*Database) Initialize

func (d *Database) Initialize() (err error)

func (*Database) StartTransaction

func (d *Database) StartTransaction() (tx goap.Transaction, err error)

Jump to

Keyboard shortcuts

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