github.com/XiaoMi/Gaea@v1.2.5/backend/mocks/PooledConnect.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  package mocks
     4  
     5  import (
     6  	"time"
     7  	
     8  	mysql "github.com/XiaoMi/Gaea/mysql"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // PooledConnect is an autogenerated mock type for the PooledConnect type
    13  type PooledConnect struct {
    14  	mock.Mock
    15  }
    16  
    17  // Begin provides a mock function with given fields:
    18  func (_m *PooledConnect) Begin() error {
    19  	ret := _m.Called()
    20  
    21  	var r0 error
    22  	if rf, ok := ret.Get(0).(func() error); ok {
    23  		r0 = rf()
    24  	} else {
    25  		r0 = ret.Error(0)
    26  	}
    27  
    28  	return r0
    29  }
    30  
    31  // Close provides a mock function with given fields:
    32  func (_m *PooledConnect) Close() {
    33  	_m.Called()
    34  }
    35  
    36  // Commit provides a mock function with given fields:
    37  func (_m *PooledConnect) Commit() error {
    38  	ret := _m.Called()
    39  
    40  	var r0 error
    41  	if rf, ok := ret.Get(0).(func() error); ok {
    42  		r0 = rf()
    43  	} else {
    44  		r0 = ret.Error(0)
    45  	}
    46  
    47  	return r0
    48  }
    49  
    50  // Execute provides a mock function with given fields: sql, maxRows
    51  func (_m *PooledConnect) Execute(sql string, maxRows int) (*mysql.Result, error) {
    52  	ret := _m.Called(sql, maxRows)
    53  
    54  	var r0 *mysql.Result
    55  	if rf, ok := ret.Get(0).(func(string, int) *mysql.Result); ok {
    56  		r0 = rf(sql, maxRows)
    57  	} else {
    58  		if ret.Get(0) != nil {
    59  			r0 = ret.Get(0).(*mysql.Result)
    60  		}
    61  	}
    62  
    63  	var r1 error
    64  	if rf, ok := ret.Get(1).(func(string, int) error); ok {
    65  		r1 = rf(sql, maxRows)
    66  	} else {
    67  		r1 = ret.Error(1)
    68  	}
    69  
    70  	return r0, r1
    71  }
    72  
    73  // FieldList provides a mock function with given fields: table, wildcard
    74  func (_m *PooledConnect) FieldList(table string, wildcard string) ([]*mysql.Field, error) {
    75  	ret := _m.Called(table, wildcard)
    76  
    77  	var r0 []*mysql.Field
    78  	if rf, ok := ret.Get(0).(func(string, string) []*mysql.Field); ok {
    79  		r0 = rf(table, wildcard)
    80  	} else {
    81  		if ret.Get(0) != nil {
    82  			r0 = ret.Get(0).([]*mysql.Field)
    83  		}
    84  	}
    85  
    86  	var r1 error
    87  	if rf, ok := ret.Get(1).(func(string, string) error); ok {
    88  		r1 = rf(table, wildcard)
    89  	} else {
    90  		r1 = ret.Error(1)
    91  	}
    92  
    93  	return r0, r1
    94  }
    95  
    96  // GetAddr provides a mock function with given fields:
    97  func (_m *PooledConnect) GetAddr() string {
    98  	ret := _m.Called()
    99  
   100  	var r0 string
   101  	if rf, ok := ret.Get(0).(func() string); ok {
   102  		r0 = rf()
   103  	} else {
   104  		r0 = ret.Get(0).(string)
   105  	}
   106  
   107  	return r0
   108  }
   109  
   110  // GetConnectionID provides a mock function with given fields:
   111  func (_m *PooledConnect) GetConnectionID() int64 {
   112  	ret := _m.Called()
   113  
   114  	var r0 int64
   115  	if rf, ok := ret.Get(0).(func() int64); ok {
   116  		r0 = rf()
   117  	} else {
   118  		r0 = ret.Get(0).(int64)
   119  	}
   120  
   121  	return r0
   122  }
   123  
   124  // IsClosed provides a mock function with given fields:
   125  func (_m *PooledConnect) IsClosed() bool {
   126  	ret := _m.Called()
   127  
   128  	var r0 bool
   129  	if rf, ok := ret.Get(0).(func() bool); ok {
   130  		r0 = rf()
   131  	} else {
   132  		r0 = ret.Get(0).(bool)
   133  	}
   134  
   135  	return r0
   136  }
   137  
   138  // Reconnect provides a mock function with given fields:
   139  func (_m *PooledConnect) Reconnect() error {
   140  	ret := _m.Called()
   141  
   142  	var r0 error
   143  	if rf, ok := ret.Get(0).(func() error); ok {
   144  		r0 = rf()
   145  	} else {
   146  		r0 = ret.Error(0)
   147  	}
   148  
   149  	return r0
   150  }
   151  
   152  // Recycle provides a mock function with given fields:
   153  func (_m *PooledConnect) Recycle() {
   154  	_m.Called()
   155  }
   156  
   157  // Rollback provides a mock function with given fields:
   158  func (_m *PooledConnect) Rollback() error {
   159  	ret := _m.Called()
   160  
   161  	var r0 error
   162  	if rf, ok := ret.Get(0).(func() error); ok {
   163  		r0 = rf()
   164  	} else {
   165  		r0 = ret.Error(0)
   166  	}
   167  
   168  	return r0
   169  }
   170  
   171  // SetAutoCommit provides a mock function with given fields: v
   172  func (_m *PooledConnect) SetAutoCommit(v uint8) error {
   173  	ret := _m.Called(v)
   174  
   175  	var r0 error
   176  	if rf, ok := ret.Get(0).(func(uint8) error); ok {
   177  		r0 = rf(v)
   178  	} else {
   179  		r0 = ret.Error(0)
   180  	}
   181  
   182  	return r0
   183  }
   184  
   185  // SetCharset provides a mock function with given fields: charset, collation
   186  func (_m *PooledConnect) SetCharset(charset string, collation mysql.CollationID) (bool, error) {
   187  	ret := _m.Called(charset, collation)
   188  
   189  	var r0 bool
   190  	if rf, ok := ret.Get(0).(func(string, mysql.CollationID) bool); ok {
   191  		r0 = rf(charset, collation)
   192  	} else {
   193  		r0 = ret.Get(0).(bool)
   194  	}
   195  
   196  	var r1 error
   197  	if rf, ok := ret.Get(1).(func(string, mysql.CollationID) error); ok {
   198  		r1 = rf(charset, collation)
   199  	} else {
   200  		r1 = ret.Error(1)
   201  	}
   202  
   203  	return r0, r1
   204  }
   205  
   206  // SetSessionVariables provides a mock function with given fields: frontend
   207  func (_m *PooledConnect) SetSessionVariables(frontend *mysql.SessionVariables) (bool, error) {
   208  	ret := _m.Called(frontend)
   209  
   210  	var r0 bool
   211  	if rf, ok := ret.Get(0).(func(*mysql.SessionVariables) bool); ok {
   212  		r0 = rf(frontend)
   213  	} else {
   214  		r0 = ret.Get(0).(bool)
   215  	}
   216  
   217  	var r1 error
   218  	if rf, ok := ret.Get(1).(func(*mysql.SessionVariables) error); ok {
   219  		r1 = rf(frontend)
   220  	} else {
   221  		r1 = ret.Error(1)
   222  	}
   223  
   224  	return r0, r1
   225  }
   226  
   227  // UseDB provides a mock function with given fields: db
   228  func (_m *PooledConnect) UseDB(db string) error {
   229  	ret := _m.Called(db)
   230  
   231  	var r0 error
   232  	if rf, ok := ret.Get(0).(func(string) error); ok {
   233  		r0 = rf(db)
   234  	} else {
   235  		r0 = ret.Error(0)
   236  	}
   237  
   238  	return r0
   239  }
   240  
   241  // WriteSetStatement provides a mock function with given fields:
   242  func (_m *PooledConnect) WriteSetStatement() error {
   243  	ret := _m.Called()
   244  
   245  	var r0 error
   246  	if rf, ok := ret.Get(0).(func() error); ok {
   247  		r0 = rf()
   248  	} else {
   249  		r0 = ret.Error(0)
   250  	}
   251  
   252  	return r0
   253  }
   254  
   255  func (_m *PooledConnect) Ping() error {
   256  	ret := _m.Called()
   257  
   258  	var r0 error
   259  	if rf, ok := ret.Get(0).(func() error); ok {
   260  		r0 = rf()
   261  	} else {
   262  		r0 = ret.Error(0)
   263  	}
   264  
   265  	return r0
   266  }
   267  
   268  func (_m *PooledConnect) GetReturnTime() time.Time {
   269  	return time.Now()
   270  }