Documentation ¶
Overview ¶
Package toolcacher provides a binary caching mechanism.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cacher ¶
type CacherMock ¶
type CacherMock struct { // ClearFunc mocks the Clear method. ClearFunc func(ctx context.Context) error // GetFunc mocks the Get method. GetFunc func(ctx context.Context, pkgName string, version string) (string, error) // contains filtered or unexported fields }
CacherMock is a mock implementation of Cacher.
func TestSomethingThatUsesCacher(t *testing.T) { // make and configure a mocked Cacher mockedCacher := &CacherMock{ ClearFunc: func(ctx context.Context) error { panic("mock out the Clear method") }, GetFunc: func(ctx context.Context, pkgName string, version string) (string, error) { panic("mock out the Get method") }, } // use mockedCacher in code that requires Cacher // and then make assertions. }
func (*CacherMock) Clear ¶
func (mock *CacherMock) Clear(ctx context.Context) error
Clear calls ClearFunc.
func (*CacherMock) ClearCalls ¶
func (mock *CacherMock) ClearCalls() []struct { Ctx context.Context }
ClearCalls gets all the calls that were made to Clear. Check the length with:
len(mockedCacher.ClearCalls())
Click to show internal directories.
Click to hide internal directories.