Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const DefaultTimeOut = "2s"
Variables ¶
View Source
var ( // IsRecordNotFoundError ... IsRecordNotFoundError = gorm.IsRecordNotFoundError // ErrRecordNotFound returns a "record not found error". Occurs only when attempting to query the database with a struct; querying with a slice won't return this error ErrRecordNotFound = gorm.ErrRecordNotFound // ErrInvalidSQL occurs when you attempt a query with invalid SQL ErrInvalidSQL = gorm.ErrInvalidSQL // ErrInvalidTransaction occurs when you are trying to `Commit` or `Rollback` ErrInvalidTransaction = gorm.ErrInvalidTransaction // ErrCantStartTransaction can't start transaction when you are trying to start one with `Begin` ErrCantStartTransaction = gorm.ErrCantStartTransaction // ErrUnaddressable unaddressable value ErrUnaddressable = gorm.ErrUnaddressable )
Functions ¶
This section is empty.
Types ¶
type CallbackProcessor ¶
type CallbackProcessor = gorm.CallbackProcessor
CallbackProcessor alias of gorm.CallbackProcessor
type DSN ¶
type DSN struct { User string // Username Password string // Password (requires User) Net string // Network type Addr string // Network address (requires Net) DBName string // Database name Params map[string]string // Connection parameters }
DSN ...
type MysqlHealthCheck ¶
type MysqlHealthCheck struct {
DSN string `json:"dsn"`
}
MysqlHealthCheck mysql check config
Example ¶
// get instance mysqlHealthCheck := NewMysqlHealthCheck() // LoadExtConfig err := mysqlHealthCheck.LoadExtConfig(DsnConfig) if err != nil { fmt.Println(err) } // DoHealthCheck resHealthCheck, err := mysqlHealthCheck.DoHealthCheck() if err != nil { fmt.Println(err) } fmt.Println(resHealthCheck)
Output:
func NewMysqlHealthCheck ¶
func NewMysqlHealthCheck() *MysqlHealthCheck
NewMysqlHealthCheck new a instance
func (*MysqlHealthCheck) DoHealthCheck ¶
func (h *MysqlHealthCheck) DoHealthCheck() (resHealthCheck *view.ResHealthCheck, err error)
DoHealthCheck check is invoked periodically to perform the mysql check
func (*MysqlHealthCheck) LoadExtConfig ¶
func (h *MysqlHealthCheck) LoadExtConfig(extConfig string) (err error)
LoadExtConfig parse config
Click to show internal directories.
Click to hide internal directories.