gcloud

package
v0.0.0-...-c28e036 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package gcloud is a generated GoMock package.

Index

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 NewGCSClient(client *storage.Client) *GCSClient

func (*GCSClient) CreateBucket

func (gcs *GCSClient) CreateBucket(ctx context.Context, projectId, bucketName string, attrs *storage.BucketAttrs) error

func (*GCSClient) DeleteBucket

func (gcs *GCSClient) DeleteBucket(ctx context.Context, bucketName string) error

func (*GCSClient) DeleteObject

func (gcs *GCSClient) DeleteObject(ctx context.Context, bucketName, objectName string, genNumber int64) error

func (*GCSClient) GetAttrs

func (gcs *GCSClient) GetAttrs(ctx context.Context, bucketName, objectName string) (*storage.ObjectAttrs, error)

func (*GCSClient) ListObjects

func (gcs *GCSClient) ListObjects(ctx context.Context, bucketName string, query *storage.Query) ObjectIterator

func (*GCSClient) NewRangeReader

func (gcs *GCSClient) NewRangeReader(ctx context.Context, bucketName, objectName string, offset, length int64) (io.ReadCloser, error)

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

func (m *MockGCS) DeleteBucket(ctx context.Context, bucketName string) error

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

EXPECT returns an object that allows the caller to indicate expected use

func (*MockObjectIterator) Next

Next mocks base method

type MockObjectIteratorMockRecorder

type MockObjectIteratorMockRecorder struct {
	// contains filtered or unexported fields
}

MockObjectIteratorMockRecorder is the mock recorder for MockObjectIterator

func (*MockObjectIteratorMockRecorder) Next

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

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

EXPECT returns an object that allows the caller to indicate expected use

func (*MockWriteCloserWithError) Write

func (m *MockWriteCloserWithError) Write(p []byte) (int, error)

Write mocks base method

type MockWriteCloserWithErrorMockRecorder

type MockWriteCloserWithErrorMockRecorder struct {
	// contains filtered or unexported fields
}

MockWriteCloserWithErrorMockRecorder is the mock recorder for MockWriteCloserWithError

func (*MockWriteCloserWithErrorMockRecorder) Attrs

Attrs indicates an expected call of Attrs

func (*MockWriteCloserWithErrorMockRecorder) Close

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL