Documentation ¶
Overview ¶
Package diskstorage is a generated GoMock package.
Index ¶
- type DiskStorage
- type GoMockDiskStorage
- func (m *GoMockDiskStorage) Delete(filePath string) error
- func (m *GoMockDiskStorage) Download(ctx context.Context, targetURL, filePath string) error
- func (m *GoMockDiskStorage) EXPECT() *GoMockDiskStorageMockRecorder
- func (m *GoMockDiskStorage) GetBuffer() *bytes.Buffer
- func (m *GoMockDiskStorage) ResetBuffer()
- func (m *GoMockDiskStorage) Write(chunk []byte) error
- func (m *GoMockDiskStorage) WriteFile(filePath string, perm os.FileMode) error
- type GoMockDiskStorageMockRecorder
- func (mr *GoMockDiskStorageMockRecorder) Delete(filePath interface{}) *gomock.Call
- func (mr *GoMockDiskStorageMockRecorder) Download(ctx, targetURL, filePath interface{}) *gomock.Call
- func (mr *GoMockDiskStorageMockRecorder) GetBuffer() *gomock.Call
- func (mr *GoMockDiskStorageMockRecorder) ResetBuffer() *gomock.Call
- func (mr *GoMockDiskStorageMockRecorder) Write(chunk interface{}) *gomock.Call
- func (mr *GoMockDiskStorageMockRecorder) WriteFile(filePath, perm interface{}) *gomock.Call
- type HTTPClient
- type MockHTTPClient
- type MockHTTPClientMockRecorder
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskStorage ¶
type DiskStorage interface { // GetBuffer returns the buffer value. GetBuffer() *bytes.Buffer // WriteFile saves the buffer with given path and permission to disk. WriteFile(filePath string, perm os.FileMode) error // Write saves the given byte slice to the buffer. Write(chunk []byte) error // Download downloads file by given target URL and save to file path. Download(ctx context.Context, targetURL, filePath string) error // Delete removes the file at the given file path. Delete(filePath string) error // ResetBuffer the buffer value. ResetBuffer() }
DiskStorage defines the methods needed to store and manage files on disk.
func New ¶
func New(opts ...Option) (DiskStorage, error)
New returns a new DiskStorage instance with an empty internal buffer.
type GoMockDiskStorage ¶
type GoMockDiskStorage struct {
// contains filtered or unexported fields
}
GoMockDiskStorage is a mock of DiskStorage interface.
func NewGoMockDiskStorage ¶
func NewGoMockDiskStorage(ctrl *gomock.Controller) *GoMockDiskStorage
NewGoMockDiskStorage creates a new mock instance.
func (*GoMockDiskStorage) Delete ¶
func (m *GoMockDiskStorage) Delete(filePath string) error
Delete mocks base method.
func (*GoMockDiskStorage) Download ¶
func (m *GoMockDiskStorage) Download(ctx context.Context, targetURL, filePath string) error
Download mocks base method.
func (*GoMockDiskStorage) EXPECT ¶
func (m *GoMockDiskStorage) EXPECT() *GoMockDiskStorageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*GoMockDiskStorage) GetBuffer ¶
func (m *GoMockDiskStorage) GetBuffer() *bytes.Buffer
GetBuffer mocks base method.
func (*GoMockDiskStorage) ResetBuffer ¶
func (m *GoMockDiskStorage) ResetBuffer()
ResetBuffer mocks base method.
func (*GoMockDiskStorage) Write ¶
func (m *GoMockDiskStorage) Write(chunk []byte) error
Write mocks base method.
type GoMockDiskStorageMockRecorder ¶
type GoMockDiskStorageMockRecorder struct {
// contains filtered or unexported fields
}
GoMockDiskStorageMockRecorder is the mock recorder for GoMockDiskStorage.
func (*GoMockDiskStorageMockRecorder) Delete ¶
func (mr *GoMockDiskStorageMockRecorder) Delete(filePath interface{}) *gomock.Call
Delete indicates an expected call of Delete.
func (*GoMockDiskStorageMockRecorder) Download ¶
func (mr *GoMockDiskStorageMockRecorder) Download(ctx, targetURL, filePath interface{}) *gomock.Call
Download indicates an expected call of Download.
func (*GoMockDiskStorageMockRecorder) GetBuffer ¶
func (mr *GoMockDiskStorageMockRecorder) GetBuffer() *gomock.Call
GetBuffer indicates an expected call of GetBuffer.
func (*GoMockDiskStorageMockRecorder) ResetBuffer ¶
func (mr *GoMockDiskStorageMockRecorder) ResetBuffer() *gomock.Call
ResetBuffer indicates an expected call of ResetBuffer.
func (*GoMockDiskStorageMockRecorder) Write ¶
func (mr *GoMockDiskStorageMockRecorder) Write(chunk interface{}) *gomock.Call
Write indicates an expected call of Write.
func (*GoMockDiskStorageMockRecorder) WriteFile ¶
func (mr *GoMockDiskStorageMockRecorder) WriteFile(filePath, perm interface{}) *gomock.Call
WriteFile indicates an expected call of WriteFile.
type MockHTTPClient ¶
type MockHTTPClient struct {
// contains filtered or unexported fields
}
MockHTTPClient is a mock of HTTPClient interface.
func NewMockHTTPClient ¶
func NewMockHTTPClient(ctrl *gomock.Controller) *MockHTTPClient
NewMockHTTPClient creates a new mock instance.
func (*MockHTTPClient) EXPECT ¶
func (m *MockHTTPClient) EXPECT() *MockHTTPClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockHTTPClientMockRecorder ¶
type MockHTTPClientMockRecorder struct {
// contains filtered or unexported fields
}
MockHTTPClientMockRecorder is the mock recorder for MockHTTPClient.
func (*MockHTTPClientMockRecorder) Do ¶
func (mr *MockHTTPClientMockRecorder) Do(req interface{}) *gomock.Call
Do indicates an expected call of Do.
type Option ¶
type Option func(d *diskStorage) error
Option configures diskStorage.
func WithBuffer ¶
WithBuffer returns an option that set the buffer value.
func WithHTTPClient ¶
func WithHTTPClient(httpClient HTTPClient) Option
WithHTTPClient returns an option that set the http client.