12345678910111213141516171819202122232425262728293031323334353637383940 |
- package binlog
- import (
- "eta/eta_api/global"
- "eta/eta_api/utils"
- )
- type BinlogFormatStruct struct {
- VariableName string `orm:"column(Variable_name)"`
- Value string `orm:"column(Value)"`
- }
- func GetBinlogFormat() (item *BinlogFormatStruct, err error) {
- o := global.DbMap[utils.DbNameIndex]
- sql := `SHOW VARIABLES LIKE 'binlog_format'`
- err = o.Raw(sql).First(&item).Error
- return
- }
- type BinlogFileStruct struct {
- File string `orm:"column(File)"`
- Position uint32 `orm:"column(Position)"`
- }
- func GetShowMaster() (item *BinlogFileStruct, err error) {
- o := global.DbMap[utils.DbNameIndex]
- sql := `show master status`
- err = o.Raw(sql).First(&item).Error
- return
- }
|