v0.0.0-...-d72ca28 Latest Latest

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

Go to latest
Published: Jul 24, 2019 License: Apache-2.0 Imports: 13 Imported by: 0




View Source
const (
	CONF_DB_ACL       string = "db_acl"
	CONF_DB_OSTRO     string = "db_ostro"
	CONF_DB_REALTIME  string = "db_realtime"
	CONF_DB_REPORTING string = "db_reporting"


View Source
var ConfigPath string


func CloseDb

func CloseDb()

func CloseSession

func CloseSession()

func DB

func DB() *orm.DataContext

func DBRealtime

func DBRealtime() dbox.IConnection

func DBSession

func DBSession() *mgo.Session

func Delete

func Delete(o orm.IModel) error

func Find

func Find(o orm.IModel, filter *dbox.Filter, config toolkit.M) (dbox.ICursor, error)

func Get

func Get(o orm.IModel, id interface{}) error

func GetConfig

func GetConfig(key string, args ...string) interface{}

func GetConnectionInfo

func GetConnectionInfo(db_type string) (string, *dbox.ConnectionInfo)

func GetData

func GetData(o orm.IModel, id interface{}) error

func InitialSetDatabase

func InitialSetDatabase() error

func PrepareConnection

func PrepareConnection(db_type string) (conn dbox.IConnection, err error)

func Query

func Query(driver string, host string, other ...interface{}) *queryWrapper

func Save

func Save(o orm.IModel) error

func SetDb

func SetDb(conn dbox.IConnection) error

func SetDbRealTime

func SetDbRealTime(conn dbox.IConnection) error

func SetSession

func SetSession(conn dbox.IConnection) (e error)


type Configuration

type Configuration struct {
	ID   string `json:"_id",bson:"_id"`
	Data interface{}

func (*Configuration) GetDB

func (p *Configuration) GetDB() (toolkit.M, error)

func (*Configuration) GetPort

func (p *Configuration) GetPort() (int, error)

func (*Configuration) RecordID

func (a *Configuration) RecordID() interface{}

func (*Configuration) TableName

func (a *Configuration) TableName() string

type MetaSave

type MetaSave struct {
	// contains filtered or unexported fields

Jump to

Keyboard shortcuts

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