Documentation
¶
Index ¶
- type DataStoreMock
- func (mock *DataStoreMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
- func (mock *DataStoreMock) CheckerCalls() []struct{ ... }
- func (mock *DataStoreMock) Close(ctx context.Context) error
- func (mock *DataStoreMock) CloseCalls() []struct{ ... }
- func (mock *DataStoreMock) GetCacheTime(ctx context.Context, id string) (*models.CacheTime, error)
- func (mock *DataStoreMock) GetCacheTimeCalls() []struct{ ... }
- func (mock *DataStoreMock) IsConnected(ctx context.Context) bool
- func (mock *DataStoreMock) IsConnectedCalls() []struct{ ... }
- func (mock *DataStoreMock) UpsertCacheTime(ctx context.Context, cacheTime *models.CacheTime) error
- func (mock *DataStoreMock) UpsertCacheTimeCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataStoreMock ¶
type DataStoreMock struct {
// CheckerFunc mocks the Checker method.
CheckerFunc func(ctx context.Context, state *healthcheck.CheckState) error
// CloseFunc mocks the Close method.
CloseFunc func(ctx context.Context) error
// GetCacheTimeFunc mocks the GetCacheTime method.
GetCacheTimeFunc func(ctx context.Context, id string) (*models.CacheTime, error)
// IsConnectedFunc mocks the IsConnected method.
IsConnectedFunc func(ctx context.Context) bool
// UpsertCacheTimeFunc mocks the UpsertCacheTime method.
UpsertCacheTimeFunc func(ctx context.Context, cacheTime *models.CacheTime) error
// contains filtered or unexported fields
}
DataStoreMock is a mock implementation of api.DataStore.
func TestSomethingThatUsesDataStore(t *testing.T) {
// make and configure a mocked api.DataStore
mockedDataStore := &DataStoreMock{
CheckerFunc: func(ctx context.Context, state *healthcheck.CheckState) error {
panic("mock out the Checker method")
},
CloseFunc: func(ctx context.Context) error {
panic("mock out the Close method")
},
GetCacheTimeFunc: func(ctx context.Context, id string) (*models.CacheTime, error) {
panic("mock out the GetCacheTime method")
},
IsConnectedFunc: func(ctx context.Context) bool {
panic("mock out the IsConnected method")
},
UpsertCacheTimeFunc: func(ctx context.Context, cacheTime *models.CacheTime) error {
panic("mock out the UpsertCacheTime method")
},
}
// use mockedDataStore in code that requires api.DataStore
// and then make assertions.
}
func (*DataStoreMock) Checker ¶
func (mock *DataStoreMock) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker calls CheckerFunc.
func (*DataStoreMock) CheckerCalls ¶
func (mock *DataStoreMock) CheckerCalls() []struct { Ctx context.Context State *healthcheck.CheckState }
CheckerCalls gets all the calls that were made to Checker. Check the length with:
len(mockedDataStore.CheckerCalls())
func (*DataStoreMock) Close ¶
func (mock *DataStoreMock) Close(ctx context.Context) error
Close calls CloseFunc.
func (*DataStoreMock) CloseCalls ¶
func (mock *DataStoreMock) CloseCalls() []struct { Ctx context.Context }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedDataStore.CloseCalls())
func (*DataStoreMock) GetCacheTime ¶
GetCacheTime calls GetCacheTimeFunc.
func (*DataStoreMock) GetCacheTimeCalls ¶
func (mock *DataStoreMock) GetCacheTimeCalls() []struct { Ctx context.Context ID string }
GetCacheTimeCalls gets all the calls that were made to GetCacheTime. Check the length with:
len(mockedDataStore.GetCacheTimeCalls())
func (*DataStoreMock) IsConnected ¶
func (mock *DataStoreMock) IsConnected(ctx context.Context) bool
IsConnected calls IsConnectedFunc.
func (*DataStoreMock) IsConnectedCalls ¶
func (mock *DataStoreMock) IsConnectedCalls() []struct { Ctx context.Context }
IsConnectedCalls gets all the calls that were made to IsConnected. Check the length with:
len(mockedDataStore.IsConnectedCalls())
func (*DataStoreMock) UpsertCacheTime ¶
UpsertCacheTime calls UpsertCacheTimeFunc.
func (*DataStoreMock) UpsertCacheTimeCalls ¶
func (mock *DataStoreMock) UpsertCacheTimeCalls() []struct { Ctx context.Context CacheTime *models.CacheTime }
UpsertCacheTimeCalls gets all the calls that were made to UpsertCacheTime. Check the length with:
len(mockedDataStore.UpsertCacheTimeCalls())