Documentation ¶
Overview ¶
Package connector is a generated GoMock package.
Package connector is a generated GoMock package.
Index ¶
- Variables
- type BucketHandleWrapper
- type Client
- type GcloudStorageClient
- type MockBucketHandleWrapper
- func (m *MockBucketHandleWrapper) Attrs(ctx context.Context) (*storage.BucketAttrs, error)
- func (m *MockBucketHandleWrapper) EXPECT() *MockBucketHandleWrapperMockRecorder
- func (m *MockBucketHandleWrapper) Object(name string) ObjectHandleWrapper
- func (m *MockBucketHandleWrapper) Objects(ctx context.Context, q *storage.Query) ObjectIteratorWrapper
- type MockBucketHandleWrapperMockRecorder
- type MockClient
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) Exist(ctx context.Context, URI archiver.URI, fileName string) (bool, error)
- func (m *MockClient) Get(ctx context.Context, URI archiver.URI, file string) ([]byte, error)
- func (m *MockClient) Query(ctx context.Context, URI archiver.URI, fileNamePrefix string) ([]string, error)
- func (m *MockClient) QueryWithFilters(ctx context.Context, URI archiver.URI, fileNamePrefix string, ...) ([]string, bool, int, error)
- func (m *MockClient) Upload(ctx context.Context, URI archiver.URI, fileName string, file []byte) error
- type MockClientMockRecorder
- func (mr *MockClientMockRecorder) Exist(ctx, URI, fileName any) *gomock.Call
- func (mr *MockClientMockRecorder) Get(ctx, URI, file any) *gomock.Call
- func (mr *MockClientMockRecorder) Query(ctx, URI, fileNamePrefix any) *gomock.Call
- func (mr *MockClientMockRecorder) QueryWithFilters(ctx, URI, fileNamePrefix, pageSize, offset, filters any) *gomock.Call
- func (mr *MockClientMockRecorder) Upload(ctx, URI, fileName, file any) *gomock.Call
- type MockGcloudStorageClient
- type MockGcloudStorageClientMockRecorder
- type MockObjectHandleWrapper
- func (m *MockObjectHandleWrapper) Attrs(ctx context.Context) (*storage.ObjectAttrs, error)
- func (m *MockObjectHandleWrapper) EXPECT() *MockObjectHandleWrapperMockRecorder
- func (m *MockObjectHandleWrapper) NewReader(ctx context.Context) (ReaderWrapper, error)
- func (m *MockObjectHandleWrapper) NewWriter(ctx context.Context) WriterWrapper
- type MockObjectHandleWrapperMockRecorder
- type MockObjectIteratorWrapper
- type MockObjectIteratorWrapperMockRecorder
- type MockReaderWrapper
- type MockReaderWrapperMockRecorder
- type MockWriterWrapper
- type MockWriterWrapperMockRecorder
- type ObjectHandleWrapper
- type ObjectIteratorWrapper
- type Precondition
- type ReaderWrapper
- type WriterWrapper
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBucketNotFound is non retryable error that is thrown when the bucket doesn't exist ErrBucketNotFound = errors.New("bucket not found") )
Functions ¶
This section is empty.
Types ¶
type BucketHandleWrapper ¶
type BucketHandleWrapper interface { Object(name string) ObjectHandleWrapper Objects(ctx context.Context, q *storage.Query) ObjectIteratorWrapper Attrs(ctx context.Context) (*storage.BucketAttrs, error) }
BucketHandleWrapper is an interface that expose some methods from gcloud storage bucket
type Client ¶
type Client interface { Upload(ctx context.Context, URI archiver.URI, fileName string, file []byte) error Get(ctx context.Context, URI archiver.URI, file string) ([]byte, error) Query(ctx context.Context, URI archiver.URI, fileNamePrefix string) ([]string, error) QueryWithFilters(ctx context.Context, URI archiver.URI, fileNamePrefix string, pageSize, offset int, filters []Precondition) ([]string, bool, int, error) Exist(ctx context.Context, URI archiver.URI, fileName string) (bool, error) }
Client is a wrapper around Google cloud storages client library.
func NewClient ¶
NewClient return a Temporal gcloudstorage.Client based on default google service account creadentials (ScopeFullControl required). Bucket must be created by Iaas scripts, in other words, this library doesn't create the required Bucket. Optionaly you can set your credential path throught "GOOGLE_APPLICATION_CREDENTIALS" environment variable or through temporal config file. You can find more info about "Google Setting Up Authentication for Server to Server Production Applications" under the following link https://cloud.google.com/docs/authentication/production
func NewClientWithParams ¶
func NewClientWithParams(clientD GcloudStorageClient) (Client, error)
NewClientWithParams return a gcloudstorage.Client based on input parameters
type GcloudStorageClient ¶
type GcloudStorageClient interface {
Bucket(URI string) BucketHandleWrapper
}
GcloudStorageClient is an interface that expose some methods from gcloud storage client
type MockBucketHandleWrapper ¶ added in v1.5.7
type MockBucketHandleWrapper struct {
// contains filtered or unexported fields
}
MockBucketHandleWrapper is a mock of BucketHandleWrapper interface.
func NewMockBucketHandleWrapper ¶ added in v1.5.7
func NewMockBucketHandleWrapper(ctrl *gomock.Controller) *MockBucketHandleWrapper
NewMockBucketHandleWrapper creates a new mock instance.
func (*MockBucketHandleWrapper) Attrs ¶ added in v1.5.7
func (m *MockBucketHandleWrapper) Attrs(ctx context.Context) (*storage.BucketAttrs, error)
Attrs mocks base method.
func (*MockBucketHandleWrapper) EXPECT ¶ added in v1.5.7
func (m *MockBucketHandleWrapper) EXPECT() *MockBucketHandleWrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBucketHandleWrapper) Object ¶ added in v1.5.7
func (m *MockBucketHandleWrapper) Object(name string) ObjectHandleWrapper
Object mocks base method.
func (*MockBucketHandleWrapper) Objects ¶ added in v1.5.7
func (m *MockBucketHandleWrapper) Objects(ctx context.Context, q *storage.Query) ObjectIteratorWrapper
Objects mocks base method.
type MockBucketHandleWrapperMockRecorder ¶ added in v1.5.7
type MockBucketHandleWrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockBucketHandleWrapperMockRecorder is the mock recorder for MockBucketHandleWrapper.
func (*MockBucketHandleWrapperMockRecorder) Attrs ¶ added in v1.5.7
func (mr *MockBucketHandleWrapperMockRecorder) Attrs(ctx any) *gomock.Call
Attrs indicates an expected call of Attrs.
type MockClient ¶ added in v1.5.7
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶ added in v1.5.7
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) EXPECT ¶ added in v1.5.7
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) Query ¶ added in v1.5.7
func (m *MockClient) Query(ctx context.Context, URI archiver.URI, fileNamePrefix string) ([]string, error)
Query mocks base method.
func (*MockClient) QueryWithFilters ¶ added in v1.5.7
func (m *MockClient) QueryWithFilters(ctx context.Context, URI archiver.URI, fileNamePrefix string, pageSize, offset int, filters []Precondition) ([]string, bool, int, error)
QueryWithFilters mocks base method.
type MockClientMockRecorder ¶ added in v1.5.7
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) Exist ¶ added in v1.5.7
func (mr *MockClientMockRecorder) Exist(ctx, URI, fileName any) *gomock.Call
Exist indicates an expected call of Exist.
func (*MockClientMockRecorder) Get ¶ added in v1.5.7
func (mr *MockClientMockRecorder) Get(ctx, URI, file any) *gomock.Call
Get indicates an expected call of Get.
func (*MockClientMockRecorder) Query ¶ added in v1.5.7
func (mr *MockClientMockRecorder) Query(ctx, URI, fileNamePrefix any) *gomock.Call
Query indicates an expected call of Query.
func (*MockClientMockRecorder) QueryWithFilters ¶ added in v1.5.7
func (mr *MockClientMockRecorder) QueryWithFilters(ctx, URI, fileNamePrefix, pageSize, offset, filters any) *gomock.Call
QueryWithFilters indicates an expected call of QueryWithFilters.
type MockGcloudStorageClient ¶ added in v1.5.7
type MockGcloudStorageClient struct {
// contains filtered or unexported fields
}
MockGcloudStorageClient is a mock of GcloudStorageClient interface.
func NewMockGcloudStorageClient ¶ added in v1.5.7
func NewMockGcloudStorageClient(ctrl *gomock.Controller) *MockGcloudStorageClient
NewMockGcloudStorageClient creates a new mock instance.
func (*MockGcloudStorageClient) Bucket ¶ added in v1.5.7
func (m *MockGcloudStorageClient) Bucket(URI string) BucketHandleWrapper
Bucket mocks base method.
func (*MockGcloudStorageClient) EXPECT ¶ added in v1.5.7
func (m *MockGcloudStorageClient) EXPECT() *MockGcloudStorageClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockGcloudStorageClientMockRecorder ¶ added in v1.5.7
type MockGcloudStorageClientMockRecorder struct {
// contains filtered or unexported fields
}
MockGcloudStorageClientMockRecorder is the mock recorder for MockGcloudStorageClient.
type MockObjectHandleWrapper ¶ added in v1.5.7
type MockObjectHandleWrapper struct {
// contains filtered or unexported fields
}
MockObjectHandleWrapper is a mock of ObjectHandleWrapper interface.
func NewMockObjectHandleWrapper ¶ added in v1.5.7
func NewMockObjectHandleWrapper(ctrl *gomock.Controller) *MockObjectHandleWrapper
NewMockObjectHandleWrapper creates a new mock instance.
func (*MockObjectHandleWrapper) Attrs ¶ added in v1.5.7
func (m *MockObjectHandleWrapper) Attrs(ctx context.Context) (*storage.ObjectAttrs, error)
Attrs mocks base method.
func (*MockObjectHandleWrapper) EXPECT ¶ added in v1.5.7
func (m *MockObjectHandleWrapper) EXPECT() *MockObjectHandleWrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockObjectHandleWrapper) NewReader ¶ added in v1.5.7
func (m *MockObjectHandleWrapper) NewReader(ctx context.Context) (ReaderWrapper, error)
NewReader mocks base method.
func (*MockObjectHandleWrapper) NewWriter ¶ added in v1.5.7
func (m *MockObjectHandleWrapper) NewWriter(ctx context.Context) WriterWrapper
NewWriter mocks base method.
type MockObjectHandleWrapperMockRecorder ¶ added in v1.5.7
type MockObjectHandleWrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockObjectHandleWrapperMockRecorder is the mock recorder for MockObjectHandleWrapper.
func (*MockObjectHandleWrapperMockRecorder) Attrs ¶ added in v1.5.7
func (mr *MockObjectHandleWrapperMockRecorder) Attrs(ctx any) *gomock.Call
Attrs indicates an expected call of Attrs.
type MockObjectIteratorWrapper ¶ added in v1.5.7
type MockObjectIteratorWrapper struct {
// contains filtered or unexported fields
}
MockObjectIteratorWrapper is a mock of ObjectIteratorWrapper interface.
func NewMockObjectIteratorWrapper ¶ added in v1.5.7
func NewMockObjectIteratorWrapper(ctrl *gomock.Controller) *MockObjectIteratorWrapper
NewMockObjectIteratorWrapper creates a new mock instance.
func (*MockObjectIteratorWrapper) EXPECT ¶ added in v1.5.7
func (m *MockObjectIteratorWrapper) EXPECT() *MockObjectIteratorWrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockObjectIteratorWrapper) Next ¶ added in v1.5.7
func (m *MockObjectIteratorWrapper) Next() (*storage.ObjectAttrs, error)
Next mocks base method.
type MockObjectIteratorWrapperMockRecorder ¶ added in v1.5.7
type MockObjectIteratorWrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockObjectIteratorWrapperMockRecorder is the mock recorder for MockObjectIteratorWrapper.
func (*MockObjectIteratorWrapperMockRecorder) Next ¶ added in v1.5.7
func (mr *MockObjectIteratorWrapperMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next.
type MockReaderWrapper ¶ added in v1.5.7
type MockReaderWrapper struct {
// contains filtered or unexported fields
}
MockReaderWrapper is a mock of ReaderWrapper interface.
func NewMockReaderWrapper ¶ added in v1.5.7
func NewMockReaderWrapper(ctrl *gomock.Controller) *MockReaderWrapper
NewMockReaderWrapper creates a new mock instance.
func (*MockReaderWrapper) Close ¶ added in v1.5.7
func (m *MockReaderWrapper) Close() error
Close mocks base method.
func (*MockReaderWrapper) EXPECT ¶ added in v1.5.7
func (m *MockReaderWrapper) EXPECT() *MockReaderWrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockReaderWrapperMockRecorder ¶ added in v1.5.7
type MockReaderWrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockReaderWrapperMockRecorder is the mock recorder for MockReaderWrapper.
func (*MockReaderWrapperMockRecorder) Close ¶ added in v1.5.7
func (mr *MockReaderWrapperMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
type MockWriterWrapper ¶ added in v1.5.7
type MockWriterWrapper struct {
// contains filtered or unexported fields
}
MockWriterWrapper is a mock of WriterWrapper interface.
func NewMockWriterWrapper ¶ added in v1.5.7
func NewMockWriterWrapper(ctrl *gomock.Controller) *MockWriterWrapper
NewMockWriterWrapper creates a new mock instance.
func (*MockWriterWrapper) Close ¶ added in v1.5.7
func (m *MockWriterWrapper) Close() error
Close mocks base method.
func (*MockWriterWrapper) CloseWithError ¶ added in v1.5.7
func (m *MockWriterWrapper) CloseWithError(err error) error
CloseWithError mocks base method.
func (*MockWriterWrapper) EXPECT ¶ added in v1.5.7
func (m *MockWriterWrapper) EXPECT() *MockWriterWrapperMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockWriterWrapperMockRecorder ¶ added in v1.5.7
type MockWriterWrapperMockRecorder struct {
// contains filtered or unexported fields
}
MockWriterWrapperMockRecorder is the mock recorder for MockWriterWrapper.
func (*MockWriterWrapperMockRecorder) Close ¶ added in v1.5.7
func (mr *MockWriterWrapperMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockWriterWrapperMockRecorder) CloseWithError ¶ added in v1.5.7
func (mr *MockWriterWrapperMockRecorder) CloseWithError(err any) *gomock.Call
CloseWithError indicates an expected call of CloseWithError.
type ObjectHandleWrapper ¶
type ObjectHandleWrapper interface { NewWriter(ctx context.Context) WriterWrapper NewReader(ctx context.Context) (ReaderWrapper, error) Attrs(ctx context.Context) (*storage.ObjectAttrs, error) }
ObjectHandleWrapper is an interface that expose some methods from gcloud storage object
type ObjectIteratorWrapper ¶
type ObjectIteratorWrapper interface {
Next() (*storage.ObjectAttrs, error)
}
ObjectIteratorWrapper is an interface that expose some methods from gcloud storage objectIterator
type Precondition ¶
type Precondition func(subject interface{}) bool
Precondition is a function that allow you to filter a query result. If subject match params conditions then return true, else return false.
type ReaderWrapper ¶
ReaderWrapper is an interface that expose some methods from gcloud storage reader