base.go 601 B

1234567891011121314151617181920212223242526
  1. package index
  2. import "eta_gn/eta_bridge/global"
  3. type BinlogFormatStruct struct {
  4. VariableName string `json:"Variable_name"`
  5. Value string `json:"Value"`
  6. }
  7. func GetBinlogFormat() (item *BinlogFormatStruct, err error) {
  8. sql := `SHOW VARIABLES LIKE 'binlog_format';`
  9. err = global.MYSQL["index"].Raw(sql).First(&item).Error
  10. return
  11. }
  12. type BinlogFileStruct struct {
  13. File string `json:"File"`
  14. Position uint32 `json:"Position"`
  15. }
  16. func GetShowMaster() (item *BinlogFileStruct, err error) {
  17. sql := `show master status;`
  18. err = global.MYSQL["index"].Raw(sql).First(&item).Error
  19. return
  20. }