Documentation ¶
Index ¶
- type MockGCSClient
- func (m *MockGCSClient) AllFilesInDirectory(ctx context.Context, folder string, callback func(item *storage.ObjectAttrs)) error
- func (m *MockGCSClient) Bucket() string
- func (m *MockGCSClient) DeleteFile(ctx context.Context, path string) error
- func (m *MockGCSClient) DoesFileExist(ctx context.Context, path string) (bool, error)
- func (m *MockGCSClient) FileReader(ctx context.Context, path string) (io.ReadCloser, error)
- func (m *MockGCSClient) FileWriter(ctx context.Context, path string, opts gcs.FileWriteOptions) io.WriteCloser
- func (m *MockGCSClient) GetFileContents(ctx context.Context, path string) ([]byte, error)
- func (m *MockGCSClient) SetFileContents(ctx context.Context, path string, opts gcs.FileWriteOptions, contents []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockGCSClient ¶
MockGCSClient is a mock of gcs.GCSClient. All the methods are mocked using testify's mocking library. See the README in this directory for some example mocks. This struct can be embedded to extend to instance-specific GCS functions. See fuzzer for an example.
func New ¶
func New() *MockGCSClient
New returns a pointer to a newly created struct. We return the pointer because we want to make sure the methods on mock.Mock stay accessible, e.g. m.On()
func (*MockGCSClient) AllFilesInDirectory ¶
func (m *MockGCSClient) AllFilesInDirectory(ctx context.Context, folder string, callback func(item *storage.ObjectAttrs)) error
func (*MockGCSClient) Bucket ¶
func (m *MockGCSClient) Bucket() string
func (*MockGCSClient) DeleteFile ¶
func (m *MockGCSClient) DeleteFile(ctx context.Context, path string) error
func (*MockGCSClient) DoesFileExist ¶
func (*MockGCSClient) FileReader ¶
func (m *MockGCSClient) FileReader(ctx context.Context, path string) (io.ReadCloser, error)
func (*MockGCSClient) FileWriter ¶
func (m *MockGCSClient) FileWriter(ctx context.Context, path string, opts gcs.FileWriteOptions) io.WriteCloser
func (*MockGCSClient) GetFileContents ¶
func (*MockGCSClient) SetFileContents ¶
func (m *MockGCSClient) SetFileContents(ctx context.Context, path string, opts gcs.FileWriteOptions, contents []byte) error
Click to show internal directories.
Click to hide internal directories.