Documentation ¶
Index ¶
- func AsResource(opts ...AsResourceOpt) internal.Resource
- func CloseDbConnection()
- func DbeEngine() *gorm.DB
- func GormDb1() *gorm.DB
- func OpenDbConnection() (err error)
- func OpenDbConnectionWith(url string) (err error)
- type AsResourceOpt
- type DB
- func (db *DB) AddRoles(loginName string, roleNames []string) (err error)
- func (db *DB) AddRolesFor(user *models.User, roleNames []string) (err error)
- func (db *DB) Close()
- func (db *DB) CloseX() (err error)
- func (db *DB) Engine() *gorm.DB
- func (db *DB) EnsureUserRole(loginName, roleName string) (err error)
- func (db *DB) EnsureUserRoles(loginName string, roleNames []string) (err error)
- func (db *DB) LoadRoles(r *models.User) (roles []*models.Role, err error)
- func (db *DB) Open() (err error)
- func (db *DB) OpenUrl(driver, url string) (err error)
- func (db *DB) OpenX() (err error)
- func (db *DB) OpenXUrl(driver, url string) (err error)
- func (db *DB) RegisterModels(models ...interface{}) *DB
- func (db *DB) UserDrop(loginName string) (err error)
- func (db *DB) XormEngine() *xorm.Engine
- type DatabaseConfig
- type GormLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsResource ¶
func AsResource(opts ...AsResourceOpt) internal.Resource
func CloseDbConnection ¶
func CloseDbConnection()
func OpenDbConnection ¶
func OpenDbConnection() (err error)
func OpenDbConnectionWith ¶
Types ¶
type AsResourceOpt ¶
type AsResourceOpt func(r *asResource)
func WithConnectUri ¶
func WithConnectUri(driver string, uri string) AsResourceOpt
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
var DBE1 *DB
func (*DB) AddRolesFor ¶
func (*DB) EnsureUserRole ¶
func (*DB) EnsureUserRoles ¶
func (*DB) RegisterModels ¶
func (*DB) XormEngine ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Name string `yaml:"-"` Username string `yaml:"username"` Password string `yaml:"password"` Url string `yaml:"url"` ConnectionTimeout int64 `yaml:"connectionTimeout"` MaxOpenConns int `yaml:"maxOpenConns"` MaxIdleConns int `yaml:"maxIdleConns"` // contains filtered or unexported fields }
func InitDatabaseConfig ¶
func InitDatabaseConfig() *DatabaseConfig
type GormLogger ¶
type GormLogger struct{}
func (*GormLogger) Print ¶
func (*GormLogger) Print(v ...interface{})
Click to show internal directories.
Click to hide internal directories.