Documentation ¶
Index ¶
- type Memcache
- type MemcacheMock
- type Pipeline
- type PipelineMock
- func (mock *PipelineMock) Delete(key string, options memproxy.DeleteOptions) func() (memproxy.DeleteResponse, error)
- func (mock *PipelineMock) DeleteCalls() []struct{ ... }
- func (mock *PipelineMock) Execute()
- func (mock *PipelineMock) ExecuteCalls() []struct{}
- func (mock *PipelineMock) Finish()
- func (mock *PipelineMock) FinishCalls() []struct{}
- func (mock *PipelineMock) LeaseGet(key string, options memproxy.LeaseGetOptions) memproxy.LeaseGetResult
- func (mock *PipelineMock) LeaseGetCalls() []struct{ ... }
- func (mock *PipelineMock) LeaseSet(key string, data []byte, cas uint64, options memproxy.LeaseSetOptions) func() (memproxy.LeaseSetResponse, error)
- func (mock *PipelineMock) LeaseSetCalls() []struct{ ... }
- func (mock *PipelineMock) LowerSession() memproxy.Session
- func (mock *PipelineMock) LowerSessionCalls() []struct{}
- type Session
- type SessionMock
- func (mock *SessionMock) AddDelayedCall(d time.Duration, fn memproxy.CallbackFunc)
- func (mock *SessionMock) AddDelayedCallCalls() []struct{ ... }
- func (mock *SessionMock) AddNextCall(fn memproxy.CallbackFunc)
- func (mock *SessionMock) AddNextCallCalls() []struct{ ... }
- func (mock *SessionMock) Execute()
- func (mock *SessionMock) ExecuteCalls() []struct{}
- func (mock *SessionMock) GetLower() memproxy.Session
- func (mock *SessionMock) GetLowerCalls() []struct{}
- type SessionProvider
- type SessionProviderMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemcacheMock ¶
type MemcacheMock struct { // CloseFunc mocks the Close method. CloseFunc func() error // PipelineFunc mocks the Pipeline method. PipelineFunc func(ctx context.Context, options ...memproxy.PipelineOption) memproxy.Pipeline // contains filtered or unexported fields }
MemcacheMock is a mock implementation of Memcache.
func TestSomethingThatUsesMemcache(t *testing.T) { // make and configure a mocked Memcache mockedMemcache := &MemcacheMock{ CloseFunc: func() error { panic("mock out the Close method") }, PipelineFunc: func(ctx context.Context, options ...memproxy.PipelineOption) memproxy.Pipeline { panic("mock out the Pipeline method") }, } // use mockedMemcache in code that requires Memcache // and then make assertions. }
func (*MemcacheMock) CloseCalls ¶
func (mock *MemcacheMock) CloseCalls() []struct { }
CloseCalls gets all the calls that were made to Close. Check the length with:
len(mockedMemcache.CloseCalls())
func (*MemcacheMock) Pipeline ¶
func (mock *MemcacheMock) Pipeline(ctx context.Context, options ...memproxy.PipelineOption) memproxy.Pipeline
Pipeline calls PipelineFunc.
func (*MemcacheMock) PipelineCalls ¶
func (mock *MemcacheMock) PipelineCalls() []struct { Ctx context.Context Options []memproxy.PipelineOption }
PipelineCalls gets all the calls that were made to Pipeline. Check the length with:
len(mockedMemcache.PipelineCalls())
type PipelineMock ¶
type PipelineMock struct { // DeleteFunc mocks the Delete method. DeleteFunc func(key string, options memproxy.DeleteOptions) func() (memproxy.DeleteResponse, error) // ExecuteFunc mocks the Execute method. ExecuteFunc func() // FinishFunc mocks the Finish method. FinishFunc func() // LeaseGetFunc mocks the LeaseGet method. LeaseGetFunc func(key string, options memproxy.LeaseGetOptions) memproxy.LeaseGetResult // LeaseSetFunc mocks the LeaseSet method. LeaseSetFunc func(key string, data []byte, cas uint64, options memproxy.LeaseSetOptions) func() (memproxy.LeaseSetResponse, error) // LowerSessionFunc mocks the LowerSession method. LowerSessionFunc func() memproxy.Session // contains filtered or unexported fields }
PipelineMock is a mock implementation of Pipeline.
func TestSomethingThatUsesPipeline(t *testing.T) { // make and configure a mocked Pipeline mockedPipeline := &PipelineMock{ DeleteFunc: func(key string, options memproxy.DeleteOptions) func() (memproxy.DeleteResponse, error) { panic("mock out the Delete method") }, ExecuteFunc: func() { panic("mock out the Execute method") }, FinishFunc: func() { panic("mock out the Finish method") }, LeaseGetFunc: func(key string, options memproxy.LeaseGetOptions) memproxy.LeaseGetResult { panic("mock out the LeaseGet method") }, LeaseSetFunc: func(key string, data []byte, cas uint64, options memproxy.LeaseSetOptions) func() (memproxy.LeaseSetResponse, error) { panic("mock out the LeaseSet method") }, LowerSessionFunc: func() memproxy.Session { panic("mock out the LowerSession method") }, } // use mockedPipeline in code that requires Pipeline // and then make assertions. }
func (*PipelineMock) Delete ¶
func (mock *PipelineMock) Delete(key string, options memproxy.DeleteOptions) func() (memproxy.DeleteResponse, error)
Delete calls DeleteFunc.
func (*PipelineMock) DeleteCalls ¶
func (mock *PipelineMock) DeleteCalls() []struct { Key string Options memproxy.DeleteOptions }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedPipeline.DeleteCalls())
func (*PipelineMock) ExecuteCalls ¶
func (mock *PipelineMock) ExecuteCalls() []struct { }
ExecuteCalls gets all the calls that were made to Execute. Check the length with:
len(mockedPipeline.ExecuteCalls())
func (*PipelineMock) FinishCalls ¶
func (mock *PipelineMock) FinishCalls() []struct { }
FinishCalls gets all the calls that were made to Finish. Check the length with:
len(mockedPipeline.FinishCalls())
func (*PipelineMock) LeaseGet ¶
func (mock *PipelineMock) LeaseGet(key string, options memproxy.LeaseGetOptions) memproxy.LeaseGetResult
LeaseGet calls LeaseGetFunc.
func (*PipelineMock) LeaseGetCalls ¶
func (mock *PipelineMock) LeaseGetCalls() []struct { Key string Options memproxy.LeaseGetOptions }
LeaseGetCalls gets all the calls that were made to LeaseGet. Check the length with:
len(mockedPipeline.LeaseGetCalls())
func (*PipelineMock) LeaseSet ¶
func (mock *PipelineMock) LeaseSet(key string, data []byte, cas uint64, options memproxy.LeaseSetOptions) func() (memproxy.LeaseSetResponse, error)
LeaseSet calls LeaseSetFunc.
func (*PipelineMock) LeaseSetCalls ¶
func (mock *PipelineMock) LeaseSetCalls() []struct { Key string Data []byte Cas uint64 Options memproxy.LeaseSetOptions }
LeaseSetCalls gets all the calls that were made to LeaseSet. Check the length with:
len(mockedPipeline.LeaseSetCalls())
func (*PipelineMock) LowerSession ¶
func (mock *PipelineMock) LowerSession() memproxy.Session
LowerSession calls LowerSessionFunc.
func (*PipelineMock) LowerSessionCalls ¶
func (mock *PipelineMock) LowerSessionCalls() []struct { }
LowerSessionCalls gets all the calls that were made to LowerSession. Check the length with:
len(mockedPipeline.LowerSessionCalls())
type SessionMock ¶
type SessionMock struct { // AddDelayedCallFunc mocks the AddDelayedCall method. AddDelayedCallFunc func(d time.Duration, fn memproxy.CallbackFunc) // AddNextCallFunc mocks the AddNextCall method. AddNextCallFunc func(fn memproxy.CallbackFunc) // ExecuteFunc mocks the Execute method. ExecuteFunc func() // GetLowerFunc mocks the GetLower method. GetLowerFunc func() memproxy.Session // contains filtered or unexported fields }
SessionMock is a mock implementation of Session.
func TestSomethingThatUsesSession(t *testing.T) { // make and configure a mocked Session mockedSession := &SessionMock{ AddDelayedCallFunc: func(d time.Duration, fn memproxy.CallbackFunc) { panic("mock out the AddDelayedCall method") }, AddNextCallFunc: func(fn memproxy.CallbackFunc) { panic("mock out the AddNextCall method") }, ExecuteFunc: func() { panic("mock out the Execute method") }, GetLowerFunc: func() memproxy.Session { panic("mock out the GetLower method") }, } // use mockedSession in code that requires Session // and then make assertions. }
func (*SessionMock) AddDelayedCall ¶
func (mock *SessionMock) AddDelayedCall(d time.Duration, fn memproxy.CallbackFunc)
AddDelayedCall calls AddDelayedCallFunc.
func (*SessionMock) AddDelayedCallCalls ¶
func (mock *SessionMock) AddDelayedCallCalls() []struct { D time.Duration Fn memproxy.CallbackFunc }
AddDelayedCallCalls gets all the calls that were made to AddDelayedCall. Check the length with:
len(mockedSession.AddDelayedCallCalls())
func (*SessionMock) AddNextCall ¶
func (mock *SessionMock) AddNextCall(fn memproxy.CallbackFunc)
AddNextCall calls AddNextCallFunc.
func (*SessionMock) AddNextCallCalls ¶
func (mock *SessionMock) AddNextCallCalls() []struct { Fn memproxy.CallbackFunc }
AddNextCallCalls gets all the calls that were made to AddNextCall. Check the length with:
len(mockedSession.AddNextCallCalls())
func (*SessionMock) ExecuteCalls ¶
func (mock *SessionMock) ExecuteCalls() []struct { }
ExecuteCalls gets all the calls that were made to Execute. Check the length with:
len(mockedSession.ExecuteCalls())
func (*SessionMock) GetLower ¶
func (mock *SessionMock) GetLower() memproxy.Session
GetLower calls GetLowerFunc.
func (*SessionMock) GetLowerCalls ¶
func (mock *SessionMock) GetLowerCalls() []struct { }
GetLowerCalls gets all the calls that were made to GetLower. Check the length with:
len(mockedSession.GetLowerCalls())
type SessionProviderMock ¶
type SessionProviderMock struct { // NewFunc mocks the New method. NewFunc func() memproxy.Session // contains filtered or unexported fields }
SessionProviderMock is a mock implementation of SessionProvider.
func TestSomethingThatUsesSessionProvider(t *testing.T) { // make and configure a mocked SessionProvider mockedSessionProvider := &SessionProviderMock{ NewFunc: func() memproxy.Session { panic("mock out the New method") }, } // use mockedSessionProvider in code that requires SessionProvider // and then make assertions. }
func (*SessionProviderMock) New ¶
func (mock *SessionProviderMock) New() memproxy.Session
New calls NewFunc.
func (*SessionProviderMock) NewCalls ¶
func (mock *SessionProviderMock) NewCalls() []struct { }
NewCalls gets all the calls that were made to New. Check the length with:
len(mockedSessionProvider.NewCalls())