Versions in this module Expand all Collapse all v1 v1.0.0 Aug 20, 2018 Changes in this version + const DEFAULT_MAX_ACTIVE + const DEFAULT_TIMEOUT + func NosqlRegister(name string, nosqlDatabaseHandler nosqlDatabaseHandler) error + func NosqlUse(name string) (nosqlDatabaseHandler, error) + func Register(name string, databaseHandler databaseHandler) error + func Use(name string) (databaseHandler, error) + type DatabaseCallback interface + Create func() *gorm.CallbackProcessor + Delete func() *gorm.CallbackProcessor + Query func() *gorm.CallbackProcessor + RowQuery func() *gorm.CallbackProcessor + Update func() *gorm.CallbackProcessor + type DatabaseHandler interface + AddForeignKey func(field string, dest string, onDelete string, onUpdate string) DatabaseHandler + AddIndex func(indexName string, columns ...string) DatabaseHandler + AddUniqueIndex func(indexName string, columns ...string) DatabaseHandler + AutoMigrate func(values ...interface{}) DatabaseHandler + Begin func() DatabaseHandler + Callback func() DatabaseCallback + Close func() error + Commit func() DatabaseHandler + Count func(value interface{}) DatabaseHandler + Create func(value interface{}) DatabaseHandler + CreateTable func(models ...interface{}) DatabaseHandler + Debug func() DatabaseHandler + Delete func(value interface{}, where ...interface{}) DatabaseHandler + DropColumn func(column string) DatabaseHandler + DropTable func(values ...interface{}) DatabaseHandler + DropTableIfExists func(values ...interface{}) DatabaseHandler + Error func() error + Exec func(sql string, values ...interface{}) DatabaseHandler + Find func(out interface{}, where ...interface{}) DatabaseHandler + First func(out interface{}, where ...interface{}) DatabaseHandler + GetConfig func() map[string]interface{} + HasTable func(value interface{}) bool + Having func(query string, values ...interface{}) DatabaseHandler + Joins func(query string, args ...interface{}) DatabaseHandler + Last func(out interface{}, where ...interface{}) DatabaseHandler + Limit func(limit interface{}) DatabaseHandler + Model func(value interface{}) DatabaseHandler + ModifyColumn func(column string, typ string) DatabaseHandler + New func() DatabaseHandler + NewRecord func(value interface{}) bool + Not func(query interface{}, args ...interface{}) DatabaseHandler + Offset func(offset interface{}) DatabaseHandler + Omit func(columns ...string) DatabaseHandler + Or func(query interface{}, args ...interface{}) DatabaseHandler + Order func(value interface{}, reorder ...bool) DatabaseHandler + Pluck func(column string, value interface{}) DatabaseHandler + Raw func(sql string, values ...interface{}) DatabaseHandler + RecordNotFound func() bool + Related func(value interface{}, foreignKeys ...string) DatabaseHandler + RemoveIndex func(indexName string) DatabaseHandler + Rollback func() DatabaseHandler + Row func() *sql.Row + Rows func() (*sql.Rows, error) + Save func(value interface{}) DatabaseHandler + Scan func(dest interface{}) DatabaseHandler + Scopes func(funcs ...func(*gorm.DB) *gorm.DB) DatabaseHandler + Select func(query interface{}, args ...interface{}) DatabaseHandler + Set func(name string, value interface{}) DatabaseHandler + Table func(name string) DatabaseHandler + Unscoped func() DatabaseHandler + Update func(attrs ...interface{}) DatabaseHandler + UpdateColumn func(attrs ...interface{}) DatabaseHandler + UpdateColumns func(values interface{}) DatabaseHandler + Updates func(values interface{}, ignoreProtectedAttrs ...bool) DatabaseHandler + Where func(query interface{}, args ...interface{}) DatabaseHandler + type Handler interface + GetDatabase func(name string) (DatabaseHandler, error) + Initiate func(ctx context.Context) error + NewDatabase func(ctx context.Context, name string, config map[string]interface{}) (DatabaseHandler, error) + func NewMysqlHandler() Handler + type HbaseDatabaseCallback struct + Callback hrpc.Call + type HbaseDatabaseHandler struct + Client chan gohbase.Client + Host string + MaxActive int + MaxIdle int + Password string + Timeout time.Duration + User string + func (this *HbaseDatabaseHandler) Append(ctx context.Context, table string, key string, ...) error + func (this *HbaseDatabaseHandler) CheckAndPut(ctx context.Context, table string, key string, ...) (bool, error) + func (this *HbaseDatabaseHandler) Close() + func (this *HbaseDatabaseHandler) Delete(ctx context.Context, table string, key string, ...) (err error) + func (this *HbaseDatabaseHandler) Get(ctx context.Context, table string, key string) ([]map[string]string, error) + func (this *HbaseDatabaseHandler) GetConnection() (client interface{}, err error) + func (this *HbaseDatabaseHandler) GetConnectionPoolSize() int + func (this *HbaseDatabaseHandler) Increment(ctx context.Context, table string, key string, ...) (int64, error) + func (this *HbaseDatabaseHandler) Put(ctx context.Context, table string, key string, ...) (err error) + func (this *HbaseDatabaseHandler) ReleaseConnection(client interface{}) + func (this *HbaseDatabaseHandler) Scan(ctx context.Context, table string) (NosqlDatabaseScanner, error) + type HbaseDatabaseScanner struct + Scanner hrpc.Scanner + func (this *HbaseDatabaseScanner) Close() error + func (this *HbaseDatabaseScanner) Next() (*hrpc.Result, error) + type HbaseHandler struct + func (this *HbaseHandler) GetDatabase(name string) (NosqlDatabaseHandler, error) + func (this *HbaseHandler) Initiate(ctx context.Context) error + func (this *HbaseHandler) NewDatabase(ctx context.Context, name string, config map[string]interface{}) (NosqlDatabaseHandler, error) + type Instance struct + Config *config.Instance + Utility *utility.Instance + func NewInstance() *Instance + func (this *Instance) GetDatabase(name string) (DatabaseHandler, error) + func (this *Instance) GetNosqlDatabase(name string) (NosqlDatabaseHandler, error) + func (this *Instance) HandlerName() string + func (this *Instance) Initiate(ctx context.Context) (newCtx context.Context, err error) + func (this *Instance) NewDatabase(ctx context.Context, name string) (DatabaseHandler, error) + func (this *Instance) NewNosqlDatabase(ctx context.Context, name string) (NosqlDatabaseHandler, error) + func (this *Instance) NosqlUse(ctx context.Context, handlerName string) error + func (this *Instance) OnRequestShutdown(c *routing.Context) error + func (this *Instance) OnRequestStartup(c *routing.Context) error + func (this *Instance) OnShutdown(ctx context.Context) (context.Context, error) + func (this *Instance) OnStartup(ctx context.Context) (context.Context, error) + func (this *Instance) Use(ctx context.Context, handlerName string) error + type MysqlDatabaseHandler struct + Database string + Db *gorm.DB + Host string + MaxIdleConns int + MaxOpenConns int + Password string + Port string + ReadTimeout string + Timeout string + Timezone string + User string + WriteTimeout string + func (this *MysqlDatabaseHandler) AddForeignKey(field string, dest string, onDelete string, onUpdate string) DatabaseHandler + func (this *MysqlDatabaseHandler) AddIndex(indexName string, columns ...string) DatabaseHandler + func (this *MysqlDatabaseHandler) AddUniqueIndex(indexName string, columns ...string) DatabaseHandler + func (this *MysqlDatabaseHandler) AutoMigrate(values ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Begin() DatabaseHandler + func (this *MysqlDatabaseHandler) Callback() DatabaseCallback + func (this *MysqlDatabaseHandler) Close() error + func (this *MysqlDatabaseHandler) Commit() DatabaseHandler + func (this *MysqlDatabaseHandler) Count(value interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Create(value interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) CreateTable(models ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Debug() DatabaseHandler + func (this *MysqlDatabaseHandler) Delete(value interface{}, where ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) DropColumn(column string) DatabaseHandler + func (this *MysqlDatabaseHandler) DropTable(values ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) DropTableIfExists(values ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Error() error + func (this *MysqlDatabaseHandler) Exec(sql string, values ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Find(out interface{}, where ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) First(out interface{}, where ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) GetConfig() map[string]interface{} + func (this *MysqlDatabaseHandler) HasTable(value interface{}) bool + func (this *MysqlDatabaseHandler) Having(query string, values ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Joins(query string, args ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Last(out interface{}, where ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Limit(limit interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Model(value interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) ModifyColumn(column string, typ string) DatabaseHandler + func (this *MysqlDatabaseHandler) New() DatabaseHandler + func (this *MysqlDatabaseHandler) NewRecord(value interface{}) bool + func (this *MysqlDatabaseHandler) Not(query interface{}, args ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Offset(offset interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Omit(columns ...string) DatabaseHandler + func (this *MysqlDatabaseHandler) Or(query interface{}, args ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Order(value interface{}, reorder ...bool) DatabaseHandler + func (this *MysqlDatabaseHandler) Pluck(column string, value interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Raw(sql string, values ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) RecordNotFound() bool + func (this *MysqlDatabaseHandler) Related(value interface{}, foreignKeys ...string) DatabaseHandler + func (this *MysqlDatabaseHandler) RemoveIndex(indexName string) DatabaseHandler + func (this *MysqlDatabaseHandler) Rollback() DatabaseHandler + func (this *MysqlDatabaseHandler) Row() *sql.Row + func (this *MysqlDatabaseHandler) Rows() (*sql.Rows, error) + func (this *MysqlDatabaseHandler) Save(value interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Scan(dest interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Scopes(funcs ...func(*gorm.DB) *gorm.DB) DatabaseHandler + func (this *MysqlDatabaseHandler) Select(query interface{}, args ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Set(name string, value interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Table(name string) DatabaseHandler + func (this *MysqlDatabaseHandler) Unscoped() DatabaseHandler + func (this *MysqlDatabaseHandler) Update(attrs ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) UpdateColumn(attrs ...interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) UpdateColumns(values interface{}) DatabaseHandler + func (this *MysqlDatabaseHandler) Updates(values interface{}, ignoreProtectedAttrs ...bool) DatabaseHandler + func (this *MysqlDatabaseHandler) Where(query interface{}, args ...interface{}) DatabaseHandler + type MysqlHandler struct + func (this *MysqlHandler) GetDatabase(name string) (DatabaseHandler, error) + func (this *MysqlHandler) Initiate(ctx context.Context) error + func (this *MysqlHandler) NewDatabase(ctx context.Context, name string, config map[string]interface{}) (DatabaseHandler, error) + type NosqlDatabaseCallback interface + type NosqlDatabaseHandler interface + Append func(ctx context.Context, table string, key string, ...) error + CheckAndPut func(ctx context.Context, table string, key string, ...) (bool, error) + Close func() + Delete func(ctx context.Context, table string, key string, ...) (err error) + Get func(ctx context.Context, table string, key string) ([]map[string]string, error) + GetConnection func() (client interface{}, err error) + GetConnectionPoolSize func() int + Increment func(ctx context.Context, table string, key string, ...) (int64, error) + Put func(ctx context.Context, table string, key string, ...) (err error) + ReleaseConnection func(client interface{}) + Scan func(ctx context.Context, table string) (NosqlDatabaseScanner, error) + type NosqlDatabaseScanner interface + Close func() error + Next func() (*hrpc.Result, error) + type NosqlHandler interface + GetDatabase func(name string) (NosqlDatabaseHandler, error) + Initiate func(ctx context.Context) error + NewDatabase func(ctx context.Context, name string, config map[string]interface{}) (NosqlDatabaseHandler, error) + func NewHbaseHandler() NosqlHandler