gcpcloudstorageservice

package
v0.0.0-...-4b711b1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCPCloudStorageConfig

type GCPCloudStorageConfig interface {
	GetGCPConnection(ctx context.Context, req *models.GCPCloudStorageConfigRequest) *models.Checks
	GetBucketAccess(ctx context.Context, req *models.GCPCloudStorageConfigRequest) *models.Checks
}

func NewGCPCloudStorageConfig

func NewGCPCloudStorageConfig(logger logger.Logger) GCPCloudStorageConfig

type GCPConfigService

type GCPConfigService struct {
	Logger   logger.Logger
	Req      *models.GCPCloudStorageConfigRequest
	GCPUtils GCPUtils
}

func (*GCPConfigService) GetBucketAccess

func (*GCPConfigService) GetGCPConnection

func (*GCPConfigService) Response

func (ss *GCPConfigService) Response(Title, SuccessMsg, ErrorMsg, ResolutionMsg string, Passed bool) *models.Checks

type GCPUtils

type GCPUtils interface {
	NewSessionWithOptions(ctx context.Context, gsa *models.GcpServiceAccount) (*storage.Client, error)
	DeleteObject(ctx context.Context, obj *storage.ObjectHandle) error
	ListObjects(ctx context.Context, bucket *storage.BucketHandle, query *storage.Query) error
	NewUploader(ctx context.Context, obj *storage.ObjectHandle) error
	BucketAttributes(ctx context.Context, bucket *storage.BucketHandle) error
}

type GCPUtilsImpl

type GCPUtilsImpl struct {
	Logger logger.Logger
}

func NewGCPUtils

func NewGCPUtils(logger logger.Logger) *GCPUtilsImpl

func (*GCPUtilsImpl) BucketAttributes

func (au *GCPUtilsImpl) BucketAttributes(ctx context.Context, bucket *storage.BucketHandle) error

func (*GCPUtilsImpl) DeleteObject

func (au *GCPUtilsImpl) DeleteObject(ctx context.Context, obj *storage.ObjectHandle) error

func (*GCPUtilsImpl) ListObjects

func (au *GCPUtilsImpl) ListObjects(ctx context.Context, bucket *storage.BucketHandle, query *storage.Query) error

func (*GCPUtilsImpl) NewSessionWithOptions

func (au *GCPUtilsImpl) NewSessionWithOptions(ctx context.Context, gsa *models.GcpServiceAccount) (*storage.Client, error)

func (*GCPUtilsImpl) NewUploader

func (au *GCPUtilsImpl) NewUploader(ctx context.Context, uploadObject *storage.ObjectHandle) error

type MockGCPCloudStorageConfig

type MockGCPCloudStorageConfig struct {
	GetGCPConnectionFunc func(ctx context.Context, req *models.GCPCloudStorageConfigRequest) *models.Checks
	GetBucketAccessFunc  func(ctx context.Context, req *models.GCPCloudStorageConfigRequest) *models.Checks
}

func (*MockGCPCloudStorageConfig) GetBucketAccess

func (*MockGCPCloudStorageConfig) GetGCPConnection

Jump to

Keyboard shortcuts

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