github.com/koko1123/flow-go-1@v0.29.6/module/mempool/mock/dns_cache.go (about)

     1  // Code generated by mockery v2.13.1. DO NOT EDIT.
     2  
     3  package mempool
     4  
     5  import (
     6  	mempool "github.com/koko1123/flow-go-1/module/mempool"
     7  	mock "github.com/stretchr/testify/mock"
     8  
     9  	net "net"
    10  )
    11  
    12  // DNSCache is an autogenerated mock type for the DNSCache type
    13  type DNSCache struct {
    14  	mock.Mock
    15  }
    16  
    17  // GetDomainIp provides a mock function with given fields: _a0
    18  func (_m *DNSCache) GetDomainIp(_a0 string) (*mempool.IpRecord, bool) {
    19  	ret := _m.Called(_a0)
    20  
    21  	var r0 *mempool.IpRecord
    22  	if rf, ok := ret.Get(0).(func(string) *mempool.IpRecord); ok {
    23  		r0 = rf(_a0)
    24  	} else {
    25  		if ret.Get(0) != nil {
    26  			r0 = ret.Get(0).(*mempool.IpRecord)
    27  		}
    28  	}
    29  
    30  	var r1 bool
    31  	if rf, ok := ret.Get(1).(func(string) bool); ok {
    32  		r1 = rf(_a0)
    33  	} else {
    34  		r1 = ret.Get(1).(bool)
    35  	}
    36  
    37  	return r0, r1
    38  }
    39  
    40  // GetTxtRecord provides a mock function with given fields: _a0
    41  func (_m *DNSCache) GetTxtRecord(_a0 string) (*mempool.TxtRecord, bool) {
    42  	ret := _m.Called(_a0)
    43  
    44  	var r0 *mempool.TxtRecord
    45  	if rf, ok := ret.Get(0).(func(string) *mempool.TxtRecord); ok {
    46  		r0 = rf(_a0)
    47  	} else {
    48  		if ret.Get(0) != nil {
    49  			r0 = ret.Get(0).(*mempool.TxtRecord)
    50  		}
    51  	}
    52  
    53  	var r1 bool
    54  	if rf, ok := ret.Get(1).(func(string) bool); ok {
    55  		r1 = rf(_a0)
    56  	} else {
    57  		r1 = ret.Get(1).(bool)
    58  	}
    59  
    60  	return r0, r1
    61  }
    62  
    63  // LockIPDomain provides a mock function with given fields: _a0
    64  func (_m *DNSCache) LockIPDomain(_a0 string) (bool, error) {
    65  	ret := _m.Called(_a0)
    66  
    67  	var r0 bool
    68  	if rf, ok := ret.Get(0).(func(string) bool); ok {
    69  		r0 = rf(_a0)
    70  	} else {
    71  		r0 = ret.Get(0).(bool)
    72  	}
    73  
    74  	var r1 error
    75  	if rf, ok := ret.Get(1).(func(string) error); ok {
    76  		r1 = rf(_a0)
    77  	} else {
    78  		r1 = ret.Error(1)
    79  	}
    80  
    81  	return r0, r1
    82  }
    83  
    84  // LockTxtRecord provides a mock function with given fields: _a0
    85  func (_m *DNSCache) LockTxtRecord(_a0 string) (bool, error) {
    86  	ret := _m.Called(_a0)
    87  
    88  	var r0 bool
    89  	if rf, ok := ret.Get(0).(func(string) bool); ok {
    90  		r0 = rf(_a0)
    91  	} else {
    92  		r0 = ret.Get(0).(bool)
    93  	}
    94  
    95  	var r1 error
    96  	if rf, ok := ret.Get(1).(func(string) error); ok {
    97  		r1 = rf(_a0)
    98  	} else {
    99  		r1 = ret.Error(1)
   100  	}
   101  
   102  	return r0, r1
   103  }
   104  
   105  // PutIpDomain provides a mock function with given fields: _a0, _a1, _a2
   106  func (_m *DNSCache) PutIpDomain(_a0 string, _a1 []net.IPAddr, _a2 int64) bool {
   107  	ret := _m.Called(_a0, _a1, _a2)
   108  
   109  	var r0 bool
   110  	if rf, ok := ret.Get(0).(func(string, []net.IPAddr, int64) bool); ok {
   111  		r0 = rf(_a0, _a1, _a2)
   112  	} else {
   113  		r0 = ret.Get(0).(bool)
   114  	}
   115  
   116  	return r0
   117  }
   118  
   119  // PutTxtRecord provides a mock function with given fields: _a0, _a1, _a2
   120  func (_m *DNSCache) PutTxtRecord(_a0 string, _a1 []string, _a2 int64) bool {
   121  	ret := _m.Called(_a0, _a1, _a2)
   122  
   123  	var r0 bool
   124  	if rf, ok := ret.Get(0).(func(string, []string, int64) bool); ok {
   125  		r0 = rf(_a0, _a1, _a2)
   126  	} else {
   127  		r0 = ret.Get(0).(bool)
   128  	}
   129  
   130  	return r0
   131  }
   132  
   133  // RemoveIp provides a mock function with given fields: _a0
   134  func (_m *DNSCache) RemoveIp(_a0 string) bool {
   135  	ret := _m.Called(_a0)
   136  
   137  	var r0 bool
   138  	if rf, ok := ret.Get(0).(func(string) bool); ok {
   139  		r0 = rf(_a0)
   140  	} else {
   141  		r0 = ret.Get(0).(bool)
   142  	}
   143  
   144  	return r0
   145  }
   146  
   147  // RemoveTxt provides a mock function with given fields: _a0
   148  func (_m *DNSCache) RemoveTxt(_a0 string) bool {
   149  	ret := _m.Called(_a0)
   150  
   151  	var r0 bool
   152  	if rf, ok := ret.Get(0).(func(string) bool); ok {
   153  		r0 = rf(_a0)
   154  	} else {
   155  		r0 = ret.Get(0).(bool)
   156  	}
   157  
   158  	return r0
   159  }
   160  
   161  // Size provides a mock function with given fields:
   162  func (_m *DNSCache) Size() (uint, uint) {
   163  	ret := _m.Called()
   164  
   165  	var r0 uint
   166  	if rf, ok := ret.Get(0).(func() uint); ok {
   167  		r0 = rf()
   168  	} else {
   169  		r0 = ret.Get(0).(uint)
   170  	}
   171  
   172  	var r1 uint
   173  	if rf, ok := ret.Get(1).(func() uint); ok {
   174  		r1 = rf()
   175  	} else {
   176  		r1 = ret.Get(1).(uint)
   177  	}
   178  
   179  	return r0, r1
   180  }
   181  
   182  // UpdateIPDomain provides a mock function with given fields: _a0, _a1, _a2
   183  func (_m *DNSCache) UpdateIPDomain(_a0 string, _a1 []net.IPAddr, _a2 int64) error {
   184  	ret := _m.Called(_a0, _a1, _a2)
   185  
   186  	var r0 error
   187  	if rf, ok := ret.Get(0).(func(string, []net.IPAddr, int64) error); ok {
   188  		r0 = rf(_a0, _a1, _a2)
   189  	} else {
   190  		r0 = ret.Error(0)
   191  	}
   192  
   193  	return r0
   194  }
   195  
   196  // UpdateTxtRecord provides a mock function with given fields: _a0, _a1, _a2
   197  func (_m *DNSCache) UpdateTxtRecord(_a0 string, _a1 []string, _a2 int64) error {
   198  	ret := _m.Called(_a0, _a1, _a2)
   199  
   200  	var r0 error
   201  	if rf, ok := ret.Get(0).(func(string, []string, int64) error); ok {
   202  		r0 = rf(_a0, _a1, _a2)
   203  	} else {
   204  		r0 = ret.Error(0)
   205  	}
   206  
   207  	return r0
   208  }
   209  
   210  type mockConstructorTestingTNewDNSCache interface {
   211  	mock.TestingT
   212  	Cleanup(func())
   213  }
   214  
   215  // NewDNSCache creates a new instance of DNSCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   216  func NewDNSCache(t mockConstructorTestingTNewDNSCache) *DNSCache {
   217  	mock := &DNSCache{}
   218  	mock.Mock.Test(t)
   219  
   220  	t.Cleanup(func() { mock.AssertExpectations(t) })
   221  
   222  	return mock
   223  }