Documentation ¶
Index ¶
- type Database
- func (db *Database) AutoConnect() error
- func (db *Database) Close() error
- func (db *Database) Connect(dsn model.DSN) error
- func (db *Database) CreateRole(role *model.Role) *model.Role
- func (db *Database) DeleteRoleByID(id int)
- func (db *Database) GetRoleByID(id int) model.Role
- func (db *Database) GetRoles() []model.Role
- func (db *Database) HasTable(table string) bool
- func (db *Database) Migrate() bool
- func (db *Database) Ping() error
- func (db *Database) Rollback() bool
- func (db *Database) UpdateRoleByID(role *model.Role) *model.Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
Database struct
func (*Database) AutoConnect ¶
AutoConnect connects to a MySQL database using loaded configs
func (*Database) CreateRole ¶
CreateRole creates a new entity
func (*Database) DeleteRoleByID ¶
DeleteRoleByID deletes an entity by ID
func (*Database) GetRoleByID ¶
GetRoleByID gets an entity by ID
Click to show internal directories.
Click to hide internal directories.