s3

package
v0.0.0-...-8018a7e Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package s3 is a generated GoMock package.

Index

Constants

View Source
const (
	XmlHeader string = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GCPBucket

type GCPBucket interface {
	Create(ctx context.Context, projectID string, attrs *storage.BucketAttrs) (err error)
	Delete(ctx context.Context) (err error)
	ACL() *storage.ACLHandle
	DefaultObjectACL() *storage.ACLHandle
	Object(name string) *storage.ObjectHandle
	Attrs(ctx context.Context) (attrs *storage.BucketAttrs, err error)
	Update(ctx context.Context, uattrs storage.BucketAttrsToUpdate) (attrs *storage.BucketAttrs, err error)
	If(conds storage.BucketConditions) *storage.BucketHandle
	UserProject(projectID string) *storage.BucketHandle
	LockRetentionPolicy(ctx context.Context) error
	Objects(ctx context.Context, q *storage.Query) *storage.ObjectIterator
}

type GCPClient

type GCPClient interface {
	Bucket(name string) *storage.BucketHandle
	Close() error
}

type GCPObject

type GCPObject interface {
	ACL() *storage.ACLHandle
	Generation(gen int64) *storage.ObjectHandle
	If(conds storage.Conditions) *storage.ObjectHandle
	Key(encryptionKey []byte) *storage.ObjectHandle
	Attrs(ctx context.Context) (attrs *storage.ObjectAttrs, err error)
	Update(ctx context.Context, uattrs storage.ObjectAttrsToUpdate) (oa *storage.ObjectAttrs, err error)
	BucketName() string
	ObjectName() string
	Delete(ctx context.Context) error
	ReadCompressed(compressed bool) *storage.ObjectHandle
	NewWriter(ctx context.Context) *storage.Writer
	NewReader(ctx context.Context) (*storage.Reader, error)
	NewRangeReader(ctx context.Context, offset, length int64) (r *storage.Reader, err error)
	CopierFrom(src *storage.ObjectHandle) *storage.Copier
	ComposerFrom(srcs ...*storage.ObjectHandle) *storage.Composer
}

type GCPObjectWriter

type GCPObjectWriter interface {
	Write(p []byte) (n int, err error)
	Close() error
	CloseWithError(err error) error
	Attrs() *storage.ObjectAttrs
}

type Handler

type Handler struct {
	S3Client          s3iface.S3API
	GCPClient         func() (GCPClient, error)
	Context           *context.Context
	Config            *viper.Viper
	GCPClientToBucket func(bucket string, client GCPClient) GCPBucket
	GCPBucketToObject func(name string, bucket GCPBucket) GCPObject
	GCPObjectToWriter func(object GCPObject, ctx context.Context) GCPObjectWriter
	GCPClientPerKey   map[string]GCPClient

	GCPClientPool map[string][]GCPClient
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(config *viper.Viper) Handler

func (*Handler) BucketRename

func (handler *Handler) BucketRename(bucket string) string

func (*Handler) GCPRequestSetup

func (handler *Handler) GCPRequestSetup(request *http.Request) (GCPClient, error)

func (*Handler) GetConfig

func (handler *Handler) GetConfig() *viper.Viper

func (*Handler) GetConnection

func (handler *Handler) GetConnection(key string) (GCPClient, error)

func (*Handler) GetContext

func (handler *Handler) GetContext() *context.Context

func (*Handler) GetGCPClient

func (handler *Handler) GetGCPClient(key string) (GCPClient, error)

func (*Handler) GetS3Client

func (handler *Handler) GetS3Client() s3iface.S3API

func (*Handler) ReturnConnection

func (handler *Handler) ReturnConnection(client GCPClient, request *http.Request)

func (*Handler) ReturnConnectionByKey

func (handler *Handler) ReturnConnectionByKey(client GCPClient, key string)

func (*Handler) SetConfig

func (handler *Handler) SetConfig(config *viper.Viper)

func (*Handler) SetContext

func (handler *Handler) SetContext(context *context.Context)

func (*Handler) SetGCPClientFromCreds

func (handler *Handler) SetGCPClientFromCreds(creds *string) (GCPClient, error)

func (*Handler) SetS3Client

func (handler *Handler) SetS3Client(s3Client s3iface.S3API)

func (*Handler) Shutdown

func (handler *Handler) Shutdown()

type HandlerInterface

type HandlerInterface interface {
	GetS3Client() s3iface.S3API
	GetGCPClient(key string) GCPClient
	GetContext() *context.Context
	GetConfig() *viper.Viper
	SetS3Client(s3Client s3iface.S3API)
	SetGCPClient(key string, gcpClient GCPClient)
	SetContext(context *context.Context)
	SetConfig(config *viper.Viper)
	SetGCPClientFromCreds(creds *string) GCPClient
	GCPRequestSetup(request *http.Request) GCPClient
}

type MockGCPBucket

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

MockGCPBucket is a mock of GCPBucket interface

func NewMockGCPBucket

func NewMockGCPBucket(ctrl *gomock.Controller) *MockGCPBucket

NewMockGCPBucket creates a new mock instance

func (*MockGCPBucket) ACL

func (m *MockGCPBucket) ACL() *storage.ACLHandle

ACL mocks base method

func (*MockGCPBucket) Attrs

Attrs mocks base method

func (*MockGCPBucket) Create

func (m *MockGCPBucket) Create(arg0 context.Context, arg1 string, arg2 *storage.BucketAttrs) error

Create mocks base method

func (*MockGCPBucket) DefaultObjectACL

func (m *MockGCPBucket) DefaultObjectACL() *storage.ACLHandle

DefaultObjectACL mocks base method

func (*MockGCPBucket) Delete

func (m *MockGCPBucket) Delete(arg0 context.Context) error

Delete mocks base method

func (*MockGCPBucket) EXPECT

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

func (*MockGCPBucket) If

If mocks base method

func (*MockGCPBucket) LockRetentionPolicy

func (m *MockGCPBucket) LockRetentionPolicy(arg0 context.Context) error

LockRetentionPolicy mocks base method

func (*MockGCPBucket) Object

func (m *MockGCPBucket) Object(arg0 string) *storage.ObjectHandle

Object mocks base method

func (*MockGCPBucket) Objects

func (m *MockGCPBucket) Objects(arg0 context.Context, arg1 *storage.Query) *storage.ObjectIterator

Objects mocks base method

func (*MockGCPBucket) Update

Update mocks base method

func (*MockGCPBucket) UserProject

func (m *MockGCPBucket) UserProject(arg0 string) *storage.BucketHandle

UserProject mocks base method

type MockGCPBucketMockRecorder

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

MockGCPBucketMockRecorder is the mock recorder for MockGCPBucket

func (*MockGCPBucketMockRecorder) ACL

ACL indicates an expected call of ACL

func (*MockGCPBucketMockRecorder) Attrs

func (mr *MockGCPBucketMockRecorder) Attrs(arg0 interface{}) *gomock.Call

Attrs indicates an expected call of Attrs

func (*MockGCPBucketMockRecorder) Create

func (mr *MockGCPBucketMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call

Create indicates an expected call of Create

func (*MockGCPBucketMockRecorder) DefaultObjectACL

func (mr *MockGCPBucketMockRecorder) DefaultObjectACL() *gomock.Call

DefaultObjectACL indicates an expected call of DefaultObjectACL

func (*MockGCPBucketMockRecorder) Delete

func (mr *MockGCPBucketMockRecorder) Delete(arg0 interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockGCPBucketMockRecorder) If

func (mr *MockGCPBucketMockRecorder) If(arg0 interface{}) *gomock.Call

If indicates an expected call of If

func (*MockGCPBucketMockRecorder) LockRetentionPolicy

func (mr *MockGCPBucketMockRecorder) LockRetentionPolicy(arg0 interface{}) *gomock.Call

LockRetentionPolicy indicates an expected call of LockRetentionPolicy

func (*MockGCPBucketMockRecorder) Object

func (mr *MockGCPBucketMockRecorder) Object(arg0 interface{}) *gomock.Call

Object indicates an expected call of Object

func (*MockGCPBucketMockRecorder) Objects

func (mr *MockGCPBucketMockRecorder) Objects(arg0, arg1 interface{}) *gomock.Call

Objects indicates an expected call of Objects

func (*MockGCPBucketMockRecorder) Update

func (mr *MockGCPBucketMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update

func (*MockGCPBucketMockRecorder) UserProject

func (mr *MockGCPBucketMockRecorder) UserProject(arg0 interface{}) *gomock.Call

UserProject indicates an expected call of UserProject

type MockGCPClient

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

MockGCPClient is a mock of GCPClient interface

func NewMockGCPClient

func NewMockGCPClient(ctrl *gomock.Controller) *MockGCPClient

NewMockGCPClient creates a new mock instance

func (*MockGCPClient) Bucket

func (m *MockGCPClient) Bucket(arg0 string) *storage.BucketHandle

Bucket mocks base method

func (*MockGCPClient) Close

func (m *MockGCPClient) Close() error

Close mocks base method

func (*MockGCPClient) EXPECT

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

type MockGCPClientMockRecorder

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

MockGCPClientMockRecorder is the mock recorder for MockGCPClient

func (*MockGCPClientMockRecorder) Bucket

func (mr *MockGCPClientMockRecorder) Bucket(arg0 interface{}) *gomock.Call

Bucket indicates an expected call of Bucket

func (*MockGCPClientMockRecorder) Close

func (mr *MockGCPClientMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

type MockGCPObject

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

MockGCPObject is a mock of GCPObject interface

func NewMockGCPObject

func NewMockGCPObject(ctrl *gomock.Controller) *MockGCPObject

NewMockGCPObject creates a new mock instance

func (*MockGCPObject) ACL

func (m *MockGCPObject) ACL() *storage.ACLHandle

ACL mocks base method

func (*MockGCPObject) Attrs

Attrs mocks base method

func (*MockGCPObject) BucketName

func (m *MockGCPObject) BucketName() string

BucketName mocks base method

func (*MockGCPObject) ComposerFrom

func (m *MockGCPObject) ComposerFrom(arg0 ...*storage.ObjectHandle) *storage.Composer

ComposerFrom mocks base method

func (*MockGCPObject) CopierFrom

func (m *MockGCPObject) CopierFrom(arg0 *storage.ObjectHandle) *storage.Copier

CopierFrom mocks base method

func (*MockGCPObject) Delete

func (m *MockGCPObject) Delete(arg0 context.Context) error

Delete mocks base method

func (*MockGCPObject) EXPECT

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

func (*MockGCPObject) Generation

func (m *MockGCPObject) Generation(arg0 int64) *storage.ObjectHandle

Generation mocks base method

func (*MockGCPObject) If

If mocks base method

func (*MockGCPObject) Key

func (m *MockGCPObject) Key(arg0 []byte) *storage.ObjectHandle

Key mocks base method

func (*MockGCPObject) NewRangeReader

func (m *MockGCPObject) NewRangeReader(arg0 context.Context, arg1, arg2 int64) (*storage.Reader, error)

NewRangeReader mocks base method

func (*MockGCPObject) NewReader

func (m *MockGCPObject) NewReader(arg0 context.Context) (*storage.Reader, error)

NewReader mocks base method

func (*MockGCPObject) NewWriter

func (m *MockGCPObject) NewWriter(arg0 context.Context) *storage.Writer

NewWriter mocks base method

func (*MockGCPObject) ObjectName

func (m *MockGCPObject) ObjectName() string

ObjectName mocks base method

func (*MockGCPObject) ReadCompressed

func (m *MockGCPObject) ReadCompressed(arg0 bool) *storage.ObjectHandle

ReadCompressed mocks base method

func (*MockGCPObject) Update

Update mocks base method

type MockGCPObjectMockRecorder

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

MockGCPObjectMockRecorder is the mock recorder for MockGCPObject

func (*MockGCPObjectMockRecorder) ACL

ACL indicates an expected call of ACL

func (*MockGCPObjectMockRecorder) Attrs

func (mr *MockGCPObjectMockRecorder) Attrs(arg0 interface{}) *gomock.Call

Attrs indicates an expected call of Attrs

func (*MockGCPObjectMockRecorder) BucketName

func (mr *MockGCPObjectMockRecorder) BucketName() *gomock.Call

BucketName indicates an expected call of BucketName

func (*MockGCPObjectMockRecorder) ComposerFrom

func (mr *MockGCPObjectMockRecorder) ComposerFrom(arg0 ...interface{}) *gomock.Call

ComposerFrom indicates an expected call of ComposerFrom

func (*MockGCPObjectMockRecorder) CopierFrom

func (mr *MockGCPObjectMockRecorder) CopierFrom(arg0 interface{}) *gomock.Call

CopierFrom indicates an expected call of CopierFrom

func (*MockGCPObjectMockRecorder) Delete

func (mr *MockGCPObjectMockRecorder) Delete(arg0 interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockGCPObjectMockRecorder) Generation

func (mr *MockGCPObjectMockRecorder) Generation(arg0 interface{}) *gomock.Call

Generation indicates an expected call of Generation

func (*MockGCPObjectMockRecorder) If

func (mr *MockGCPObjectMockRecorder) If(arg0 interface{}) *gomock.Call

If indicates an expected call of If

func (*MockGCPObjectMockRecorder) Key

func (mr *MockGCPObjectMockRecorder) Key(arg0 interface{}) *gomock.Call

Key indicates an expected call of Key

func (*MockGCPObjectMockRecorder) NewRangeReader

func (mr *MockGCPObjectMockRecorder) NewRangeReader(arg0, arg1, arg2 interface{}) *gomock.Call

NewRangeReader indicates an expected call of NewRangeReader

func (*MockGCPObjectMockRecorder) NewReader

func (mr *MockGCPObjectMockRecorder) NewReader(arg0 interface{}) *gomock.Call

NewReader indicates an expected call of NewReader

func (*MockGCPObjectMockRecorder) NewWriter

func (mr *MockGCPObjectMockRecorder) NewWriter(arg0 interface{}) *gomock.Call

NewWriter indicates an expected call of NewWriter

func (*MockGCPObjectMockRecorder) ObjectName

func (mr *MockGCPObjectMockRecorder) ObjectName() *gomock.Call

ObjectName indicates an expected call of ObjectName

func (*MockGCPObjectMockRecorder) ReadCompressed

func (mr *MockGCPObjectMockRecorder) ReadCompressed(arg0 interface{}) *gomock.Call

ReadCompressed indicates an expected call of ReadCompressed

func (*MockGCPObjectMockRecorder) Update

func (mr *MockGCPObjectMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call

Update indicates an expected call of Update

type MockGCPObjectWriter

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

MockGCPObjectWriter is a mock of GCPObjectWriter interface

func NewMockGCPObjectWriter

func NewMockGCPObjectWriter(ctrl *gomock.Controller) *MockGCPObjectWriter

NewMockGCPObjectWriter creates a new mock instance

func (*MockGCPObjectWriter) Attrs

Attrs mocks base method

func (*MockGCPObjectWriter) Close

func (m *MockGCPObjectWriter) Close() error

Close mocks base method

func (*MockGCPObjectWriter) CloseWithError

func (m *MockGCPObjectWriter) CloseWithError(err error) error

CloseWithError mocks base method

func (*MockGCPObjectWriter) EXPECT

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

func (*MockGCPObjectWriter) Write

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

Write mocks base method

type MockGCPObjectWriterMockRecorder

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

MockGCPObjectWriterMockRecorder is the mock recorder for MockGCPObjectWriter

func (*MockGCPObjectWriterMockRecorder) Attrs

Attrs indicates an expected call of Attrs

func (*MockGCPObjectWriterMockRecorder) Close

Close indicates an expected call of Close

func (*MockGCPObjectWriterMockRecorder) CloseWithError

func (mr *MockGCPObjectWriterMockRecorder) CloseWithError(err interface{}) *gomock.Call

CloseWithError indicates an expected call of CloseWithError

func (*MockGCPObjectWriterMockRecorder) Write

func (mr *MockGCPObjectWriterMockRecorder) Write(p interface{}) *gomock.Call

Write indicates an expected call of Write

type MockHandlerInterface

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

MockHandlerInterface is a mock of HandlerInterface interface

func NewMockHandlerInterface

func NewMockHandlerInterface(ctrl *gomock.Controller) *MockHandlerInterface

NewMockHandlerInterface creates a new mock instance

func (*MockHandlerInterface) EXPECT

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

func (*MockHandlerInterface) GCPRequestSetup

func (m *MockHandlerInterface) GCPRequestSetup(arg0 *http.Request) GCPClient

GCPRequestSetup mocks base method

func (*MockHandlerInterface) GetConfig

func (m *MockHandlerInterface) GetConfig() *viper.Viper

GetConfig mocks base method

func (*MockHandlerInterface) GetContext

func (m *MockHandlerInterface) GetContext() *context.Context

GetContext mocks base method

func (*MockHandlerInterface) GetGCPClient

func (m *MockHandlerInterface) GetGCPClient(arg0 string) GCPClient

GetGCPClient mocks base method

func (*MockHandlerInterface) GetS3Client

func (m *MockHandlerInterface) GetS3Client() s3iface.S3API

GetS3Client mocks base method

func (*MockHandlerInterface) SetConfig

func (m *MockHandlerInterface) SetConfig(arg0 *viper.Viper)

SetConfig mocks base method

func (*MockHandlerInterface) SetContext

func (m *MockHandlerInterface) SetContext(arg0 *context.Context)

SetContext mocks base method

func (*MockHandlerInterface) SetGCPClient

func (m *MockHandlerInterface) SetGCPClient(arg0 string, arg1 GCPClient)

SetGCPClient mocks base method

func (*MockHandlerInterface) SetGCPClientFromCreds

func (m *MockHandlerInterface) SetGCPClientFromCreds(arg0 *string) GCPClient

SetGCPClientFromCreds mocks base method

func (*MockHandlerInterface) SetS3Client

func (m *MockHandlerInterface) SetS3Client(arg0 s3iface.S3API)

SetS3Client mocks base method

type MockHandlerInterfaceMockRecorder

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

MockHandlerInterfaceMockRecorder is the mock recorder for MockHandlerInterface

func (*MockHandlerInterfaceMockRecorder) GCPRequestSetup

func (mr *MockHandlerInterfaceMockRecorder) GCPRequestSetup(arg0 interface{}) *gomock.Call

GCPRequestSetup indicates an expected call of GCPRequestSetup

func (*MockHandlerInterfaceMockRecorder) GetConfig

func (mr *MockHandlerInterfaceMockRecorder) GetConfig() *gomock.Call

GetConfig indicates an expected call of GetConfig

func (*MockHandlerInterfaceMockRecorder) GetContext

func (mr *MockHandlerInterfaceMockRecorder) GetContext() *gomock.Call

GetContext indicates an expected call of GetContext

func (*MockHandlerInterfaceMockRecorder) GetGCPClient

func (mr *MockHandlerInterfaceMockRecorder) GetGCPClient(arg0 interface{}) *gomock.Call

GetGCPClient indicates an expected call of GetGCPClient

func (*MockHandlerInterfaceMockRecorder) GetS3Client

func (mr *MockHandlerInterfaceMockRecorder) GetS3Client() *gomock.Call

GetS3Client indicates an expected call of GetS3Client

func (*MockHandlerInterfaceMockRecorder) SetConfig

func (mr *MockHandlerInterfaceMockRecorder) SetConfig(arg0 interface{}) *gomock.Call

SetConfig indicates an expected call of SetConfig

func (*MockHandlerInterfaceMockRecorder) SetContext

func (mr *MockHandlerInterfaceMockRecorder) SetContext(arg0 interface{}) *gomock.Call

SetContext indicates an expected call of SetContext

func (*MockHandlerInterfaceMockRecorder) SetGCPClient

func (mr *MockHandlerInterfaceMockRecorder) SetGCPClient(arg0, arg1 interface{}) *gomock.Call

SetGCPClient indicates an expected call of SetGCPClient

func (*MockHandlerInterfaceMockRecorder) SetGCPClientFromCreds

func (mr *MockHandlerInterfaceMockRecorder) SetGCPClientFromCreds(arg0 interface{}) *gomock.Call

SetGCPClientFromCreds indicates an expected call of SetGCPClientFromCreds

func (*MockHandlerInterfaceMockRecorder) SetS3Client

func (mr *MockHandlerInterfaceMockRecorder) SetS3Client(arg0 interface{}) *gomock.Call

SetS3Client indicates an expected call of SetS3Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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