Versions in this module Expand all Collapse all v1 v1.1.0 Mar 8, 2017 v1.0.0 Mar 7, 2017 Changes in this version + func DBInit(dbConfig *config.DBConfig, logger lager.Logger) (*gorm.DB, error) + func RotateKey(db *gorm.DB, old_key, new_key []byte, logger lager.Logger, failFast bool) error + type DBBinding struct + BindingID string + CreatedAt time.Time + DBUser DBUser + DBUserID uint64 + ID uint64 + UpdatedAt time.Time + type DBInstance struct + CreatedAt time.Time + DBName string + ID uint64 + InstanceID string + PlanID string + ServiceID string + UpdatedAt time.Time + Users []DBUser + func FindInstance(db *gorm.DB, instanceID string) *DBInstance + func NewInstance(serviceID, planID, instanceID, dbPrefix string, key []byte) (*DBInstance, error) + func (i *DBInstance) Bind(db *gorm.DB, bindingID, username string, userType DBUserType, key []byte) (user DBUser, new bool, err error) + func (i *DBInstance) BindingUser(bindingID string) (*DBUser, *DBBinding) + func (i *DBInstance) Delete(db *gorm.DB) error + func (i *DBInstance) MasterUser() *DBUser + func (i *DBInstance) NewUser(userType DBUserType, key []byte) (DBUser, error) + func (i *DBInstance) Unbind(db *gorm.DB, bindingID string) (user DBUser, delete bool, err error) + func (i *DBInstance) UnderscoreID() string + func (i *DBInstance) User(username string) *DBUser + type DBUser struct + Bindings []DBBinding + CreatedAt time.Time + DBInstance DBInstance + DBInstanceID uint64 + EncryptedPassword []byte + ID uint64 + IV []byte + Type DBUserType + UpdatedAt time.Time + Username string + func NewUser(userType DBUserType, key []byte) (DBUser, error) + func (u *DBUser) Delete(db *gorm.DB) error + func (u *DBUser) Password(key []byte) (string, error) + func (u *DBUser) SetPassword(password string, key []byte) error + func (u *DBUser) SetRandomPassword(key []byte) error + type DBUserType string + const Master + const Standard + const SuperUser + func (u *DBUserType) Scan(value interface{}) error + func (u DBUserType) Value() (driver.Value, error)