Documentation ¶
Overview ¶
Package gcloud is a generated GoMock package.
Index ¶
- type GCS
- type GCSClient
- func (gcs *GCSClient) CreateBucket(ctx context.Context, projectId, bucketName string, attrs *storage.BucketAttrs) error
- func (gcs *GCSClient) DeleteBucket(ctx context.Context, bucketName string) error
- func (gcs *GCSClient) DeleteObject(ctx context.Context, bucketName, objectName string, genNumber int64) error
- func (gcs *GCSClient) GetAttrs(ctx context.Context, bucketName, objectName string) (*storage.ObjectAttrs, error)
- func (gcs *GCSClient) ListObjects(ctx context.Context, bucketName string, query *storage.Query) ObjectIterator
- func (gcs *GCSClient) NewRangeReader(ctx context.Context, bucketName, objectName string, offset, length int64) (io.ReadCloser, error)
- func (gcs *GCSClient) NewWriter(ctx context.Context, bucketName, objectName string) WriteCloserWithError
- func (gcs *GCSClient) NewWriterWithCondition(ctx context.Context, bucketName, objectName string, cond storage.Conditions) WriteCloserWithError
- type MockGCS
- func (m *MockGCS) CreateBucket(ctx context.Context, projectId, bucketName string, attrs *storage.BucketAttrs) error
- func (m *MockGCS) DeleteBucket(ctx context.Context, bucketName string) error
- func (m *MockGCS) DeleteObject(ctx context.Context, bucketName, objectName string, genNumber int64) error
- func (m *MockGCS) EXPECT() *MockGCSMockRecorder
- func (m *MockGCS) GetAttrs(ctx context.Context, bucketName, objectName string) (*storage.ObjectAttrs, error)
- func (m *MockGCS) ListObjects(ctx context.Context, bucketName string, query *storage.Query) ObjectIterator
- func (m *MockGCS) NewRangeReader(ctx context.Context, bucketName, objectName string, offset, length int64) (io.ReadCloser, error)
- func (m *MockGCS) NewWriter(ctx context.Context, bucketName, objectName string) WriteCloserWithError
- func (m *MockGCS) NewWriterWithCondition(ctx context.Context, bucketName, objectName string, cond storage.Conditions) WriteCloserWithError
- type MockGCSMockRecorder
- func (mr *MockGCSMockRecorder) CreateBucket(ctx, projectId, bucketName, attrs interface{}) *gomock.Call
- func (mr *MockGCSMockRecorder) DeleteBucket(ctx, bucketName interface{}) *gomock.Call
- func (mr *MockGCSMockRecorder) DeleteObject(ctx, bucketName, objectName, genNumber interface{}) *gomock.Call
- func (mr *MockGCSMockRecorder) GetAttrs(ctx, bucketName, objectName interface{}) *gomock.Call
- func (mr *MockGCSMockRecorder) ListObjects(ctx, bucketName, query interface{}) *gomock.Call
- func (mr *MockGCSMockRecorder) NewRangeReader(ctx, bucketName, objectName, offset, length interface{}) *gomock.Call
- func (mr *MockGCSMockRecorder) NewWriter(ctx, bucketName, objectName interface{}) *gomock.Call
- func (mr *MockGCSMockRecorder) NewWriterWithCondition(ctx, bucketName, objectName, cond interface{}) *gomock.Call
- type MockObjectIterator
- type MockObjectIteratorMockRecorder
- type MockWriteCloserWithError
- func (m *MockWriteCloserWithError) Attrs() *storage.ObjectAttrs
- func (m *MockWriteCloserWithError) Close() error
- func (m *MockWriteCloserWithError) CloseWithError(err error) error
- func (m *MockWriteCloserWithError) EXPECT() *MockWriteCloserWithErrorMockRecorder
- func (m *MockWriteCloserWithError) Write(p []byte) (int, error)
- type MockWriteCloserWithErrorMockRecorder
- func (mr *MockWriteCloserWithErrorMockRecorder) Attrs() *gomock.Call
- func (mr *MockWriteCloserWithErrorMockRecorder) Close() *gomock.Call
- func (mr *MockWriteCloserWithErrorMockRecorder) CloseWithError(err interface{}) *gomock.Call
- func (mr *MockWriteCloserWithErrorMockRecorder) Write(p interface{}) *gomock.Call
- type ObjectIterator
- type WriteCloserWithError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCS ¶
type GCS interface { CreateBucket(ctx context.Context, projectId, bucketName string, attrs *storage.BucketAttrs) error DeleteBucket(ctx context.Context, bucketName string) error DeleteObject(ctx context.Context, bucketName, objectName string, genNumber int64) error GetAttrs(ctx context.Context, bucketName, objectName string) (*storage.ObjectAttrs, error) ListObjects(ctx context.Context, bucketName string, query *storage.Query) ObjectIterator NewRangeReader(ctx context.Context, bucketName, objectName string, offset, length int64) (io.ReadCloser, error) NewWriter(ctx context.Context, bucketName, objectName string) WriteCloserWithError NewWriterWithCondition(ctx context.Context, bucketName, objectName string, cond storage.Conditions) WriteCloserWithError }
Pass-through wrapper for Google Cloud Storage client.
type GCSClient ¶
type GCSClient struct {
// contains filtered or unexported fields
}
func NewGCSClient ¶
func (*GCSClient) CreateBucket ¶
func (*GCSClient) DeleteBucket ¶
func (*GCSClient) DeleteObject ¶
func (*GCSClient) ListObjects ¶
func (*GCSClient) NewRangeReader ¶
func (*GCSClient) NewWriter ¶
func (gcs *GCSClient) NewWriter(ctx context.Context, bucketName, objectName string) WriteCloserWithError
func (*GCSClient) NewWriterWithCondition ¶
func (gcs *GCSClient) NewWriterWithCondition(ctx context.Context, bucketName, objectName string, cond storage.Conditions) WriteCloserWithError
type MockGCS ¶
type MockGCS struct {
// contains filtered or unexported fields
}
MockGCS is a mock of GCS interface
func NewMockGCS ¶
func NewMockGCS(ctrl *gomock.Controller) *MockGCS
NewMockGCS creates a new mock instance
func (*MockGCS) CreateBucket ¶
func (m *MockGCS) CreateBucket(ctx context.Context, projectId, bucketName string, attrs *storage.BucketAttrs) error
CreateBucket mocks base method
func (*MockGCS) DeleteBucket ¶
DeleteBucket mocks base method
func (*MockGCS) DeleteObject ¶
func (m *MockGCS) DeleteObject(ctx context.Context, bucketName, objectName string, genNumber int64) error
DeleteObject mocks base method
func (*MockGCS) EXPECT ¶
func (m *MockGCS) EXPECT() *MockGCSMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockGCS) GetAttrs ¶
func (m *MockGCS) GetAttrs(ctx context.Context, bucketName, objectName string) (*storage.ObjectAttrs, error)
GetAttrs mocks base method
func (*MockGCS) ListObjects ¶
func (m *MockGCS) ListObjects(ctx context.Context, bucketName string, query *storage.Query) ObjectIterator
ListObjects mocks base method
func (*MockGCS) NewRangeReader ¶
func (m *MockGCS) NewRangeReader(ctx context.Context, bucketName, objectName string, offset, length int64) (io.ReadCloser, error)
NewRangeReader mocks base method
func (*MockGCS) NewWriter ¶
func (m *MockGCS) NewWriter(ctx context.Context, bucketName, objectName string) WriteCloserWithError
NewWriter mocks base method
func (*MockGCS) NewWriterWithCondition ¶
func (m *MockGCS) NewWriterWithCondition(ctx context.Context, bucketName, objectName string, cond storage.Conditions) WriteCloserWithError
NewWriterWithCondition mocks base method
type MockGCSMockRecorder ¶
type MockGCSMockRecorder struct {
// contains filtered or unexported fields
}
MockGCSMockRecorder is the mock recorder for MockGCS
func (*MockGCSMockRecorder) CreateBucket ¶
func (mr *MockGCSMockRecorder) CreateBucket(ctx, projectId, bucketName, attrs interface{}) *gomock.Call
CreateBucket indicates an expected call of CreateBucket
func (*MockGCSMockRecorder) DeleteBucket ¶
func (mr *MockGCSMockRecorder) DeleteBucket(ctx, bucketName interface{}) *gomock.Call
DeleteBucket indicates an expected call of DeleteBucket
func (*MockGCSMockRecorder) DeleteObject ¶
func (mr *MockGCSMockRecorder) DeleteObject(ctx, bucketName, objectName, genNumber interface{}) *gomock.Call
DeleteObject indicates an expected call of DeleteObject
func (*MockGCSMockRecorder) GetAttrs ¶
func (mr *MockGCSMockRecorder) GetAttrs(ctx, bucketName, objectName interface{}) *gomock.Call
GetAttrs indicates an expected call of GetAttrs
func (*MockGCSMockRecorder) ListObjects ¶
func (mr *MockGCSMockRecorder) ListObjects(ctx, bucketName, query interface{}) *gomock.Call
ListObjects indicates an expected call of ListObjects
func (*MockGCSMockRecorder) NewRangeReader ¶
func (mr *MockGCSMockRecorder) NewRangeReader(ctx, bucketName, objectName, offset, length interface{}) *gomock.Call
NewRangeReader indicates an expected call of NewRangeReader
func (*MockGCSMockRecorder) NewWriter ¶
func (mr *MockGCSMockRecorder) NewWriter(ctx, bucketName, objectName interface{}) *gomock.Call
NewWriter indicates an expected call of NewWriter
func (*MockGCSMockRecorder) NewWriterWithCondition ¶
func (mr *MockGCSMockRecorder) NewWriterWithCondition(ctx, bucketName, objectName, cond interface{}) *gomock.Call
NewWriterWithCondition indicates an expected call of NewWriterWithCondition
type MockObjectIterator ¶
type MockObjectIterator struct {
// contains filtered or unexported fields
}
MockObjectIterator is a mock of ObjectIterator interface
func NewMockObjectIterator ¶
func NewMockObjectIterator(ctrl *gomock.Controller) *MockObjectIterator
NewMockObjectIterator creates a new mock instance
func (*MockObjectIterator) EXPECT ¶
func (m *MockObjectIterator) EXPECT() *MockObjectIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockObjectIterator) Next ¶
func (m *MockObjectIterator) Next() (*storage.ObjectAttrs, error)
Next mocks base method
type MockObjectIteratorMockRecorder ¶
type MockObjectIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockObjectIteratorMockRecorder is the mock recorder for MockObjectIterator
func (*MockObjectIteratorMockRecorder) Next ¶
func (mr *MockObjectIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
type MockWriteCloserWithError ¶
type MockWriteCloserWithError struct {
// contains filtered or unexported fields
}
MockWriteCloserWithError is a mock of WriteCloserWithError interface
func NewMockWriteCloserWithError ¶
func NewMockWriteCloserWithError(ctrl *gomock.Controller) *MockWriteCloserWithError
NewMockWriteCloserWithError creates a new mock instance
func (*MockWriteCloserWithError) Attrs ¶
func (m *MockWriteCloserWithError) Attrs() *storage.ObjectAttrs
Attrs mocks base method
func (*MockWriteCloserWithError) Close ¶
func (m *MockWriteCloserWithError) Close() error
Close mocks base method
func (*MockWriteCloserWithError) CloseWithError ¶
func (m *MockWriteCloserWithError) CloseWithError(err error) error
CloseWithError mocks base method
func (*MockWriteCloserWithError) EXPECT ¶
func (m *MockWriteCloserWithError) EXPECT() *MockWriteCloserWithErrorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockWriteCloserWithErrorMockRecorder ¶
type MockWriteCloserWithErrorMockRecorder struct {
// contains filtered or unexported fields
}
MockWriteCloserWithErrorMockRecorder is the mock recorder for MockWriteCloserWithError
func (*MockWriteCloserWithErrorMockRecorder) Attrs ¶
func (mr *MockWriteCloserWithErrorMockRecorder) Attrs() *gomock.Call
Attrs indicates an expected call of Attrs
func (*MockWriteCloserWithErrorMockRecorder) Close ¶
func (mr *MockWriteCloserWithErrorMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockWriteCloserWithErrorMockRecorder) CloseWithError ¶
func (mr *MockWriteCloserWithErrorMockRecorder) CloseWithError(err interface{}) *gomock.Call
CloseWithError indicates an expected call of CloseWithError
func (*MockWriteCloserWithErrorMockRecorder) Write ¶
func (mr *MockWriteCloserWithErrorMockRecorder) Write(p interface{}) *gomock.Call
Write indicates an expected call of Write
type ObjectIterator ¶
type ObjectIterator interface {
Next() (*storage.ObjectAttrs, error)
}
Interface to abstract out the ObjectIterator type, which contains hidden implementation details.
func NewObjectIterator ¶
func NewObjectIterator(items ...interface{}) ObjectIterator
NewObjectIterator returns an in-memory instance of ObjectIterator. Prefer this approach when mocking ListObjects, over setting up a mock of ObjectIterator.
Pass in either *storage.ObjectAttrs, or error, and it will do the right thing.
type WriteCloserWithError ¶
type WriteCloserWithError interface { io.WriteCloser CloseWithError(err error) error Attrs() *storage.ObjectAttrs }