blob_storage

package
v0.0.24-beta-4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 24 Imported by: 6

Documentation

Index

Constants

View Source
const (
	BLOB_STORAGE_AZURE BlobStorageType = "AZURE"
	BLOB_STORAGE_S3                    = "S3"
	BLOB_STORAGE_GCP                   = "GCP"
	BLOB_STORAGE_MINIO                 = "MINIO"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsS3BaseConfig

type AwsS3BaseConfig struct {
	AccessKey         string `json:"accessKey"`
	Passkey           string `json:"passkey"`
	EndpointUrl       string `json:"endpointUrl"`
	IsInSecure        bool   `json:"isInSecure"`
	BucketName        string `json:"bucketName"`
	Region            string `json:"region"`
	VersioningEnabled bool   `json:"versioningEnabled"`
}

type AwsS3Blob

type AwsS3Blob struct{}

func (*AwsS3Blob) DeleteObjectFromBlob

func (impl *AwsS3Blob) DeleteObjectFromBlob(request *BlobStorageRequest) error

func (*AwsS3Blob) DownloadBlob

func (impl *AwsS3Blob) DownloadBlob(request *BlobStorageRequest, downloadSuccess bool, numBytes int64, err error, file *os.File) (bool, int64, error)

func (*AwsS3Blob) UploadBlob

func (impl *AwsS3Blob) UploadBlob(request *BlobStorageRequest, err error) error

func (*AwsS3Blob) UploadWithSession

func (impl *AwsS3Blob) UploadWithSession(request *BlobStorageRequest) (*s3manager.UploadOutput, error)

type AzureBlob

type AzureBlob struct {
}

func (*AzureBlob) DownloadBlob

func (impl *AzureBlob) DownloadBlob(context context.Context, blobName string, config *AzureBlobBaseConfig, file *os.File) (success bool, err error)

func (*AzureBlob) UploadBlob

func (impl *AzureBlob) UploadBlob(context context.Context, blobName string, config *AzureBlobBaseConfig, inputFileName string, container string) error

type AzureBlobBaseConfig

type AzureBlobBaseConfig struct {
	Enabled           bool   `json:"enabled"`
	AccountName       string `json:"accountName"`
	AccountKey        string `json:"accountKey"`
	BlobContainerName string `json:"blobContainerName"`
}

type AzureBlobConfig

type AzureBlobConfig struct {
	Enabled               bool   `json:"enabled"`
	AccountName           string `json:"accountName"`
	BlobContainerCiLog    string `json:"blobContainerCiLog"`
	BlobContainerCiCache  string `json:"blobContainerCiCache"`
	BlobContainerArtifact string `json:"blobStorageArtifact"`
	AccountKey            string `json:"accountKey"`
}

type BlobStorageRequest

type BlobStorageRequest struct {
	StorageType         BlobStorageType
	SourceKey           string
	DestinationKey      string
	AwsS3BaseConfig     *AwsS3BaseConfig
	AzureBlobBaseConfig *AzureBlobBaseConfig
	GcpBlobBaseConfig   *GcpBlobBaseConfig
}

type BlobStorageS3Config

type BlobStorageS3Config struct {
	AccessKey                  string `json:"accessKey"`
	Passkey                    string `json:"passkey"`
	EndpointUrl                string `json:"endpointUrl"`
	IsInSecure                 bool   `json:"isInSecure"`
	CiLogBucketName            string `json:"ciLogBucketName"`
	CiLogRegion                string `json:"ciLogRegion"`
	CiLogBucketVersioning      bool   `json:"ciLogBucketVersioning"`
	CiCacheBucketName          string `json:"ciCacheBucketName"`
	CiCacheRegion              string `json:"ciCacheRegion"`
	CiCacheBucketVersioning    bool   `json:"ciCacheBucketVersioning"`
	CiArtifactBucketName       string `json:"ciArtifactBucketName"`
	CiArtifactRegion           string `json:"ciArtifactRegion"`
	CiArtifactBucketVersioning bool   `json:"ciArtifactBucketVersioning"`
}

type BlobStorageService

type BlobStorageService interface {
	PutWithCommand(request *BlobStorageRequest) error
	Get(request *BlobStorageRequest) (bool, error)
	DeleteObjectForS3(request *BlobStorageRequest) error
}

type BlobStorageServiceImpl

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

func NewBlobStorageServiceImpl

func NewBlobStorageServiceImpl(logger *zap.SugaredLogger) *BlobStorageServiceImpl

func (*BlobStorageServiceImpl) DeleteObjectForS3

func (impl *BlobStorageServiceImpl) DeleteObjectForS3(request *BlobStorageRequest) error

TODO: Have not Tested it

func (*BlobStorageServiceImpl) Get

func (impl *BlobStorageServiceImpl) Get(request *BlobStorageRequest) (bool, int64, error)

func (*BlobStorageServiceImpl) PutWithCommand

func (impl *BlobStorageServiceImpl) PutWithCommand(request *BlobStorageRequest) error

func (*BlobStorageServiceImpl) UploadToBlobWithSession

func (impl *BlobStorageServiceImpl) UploadToBlobWithSession(request *BlobStorageRequest) error

type BlobStorageType

type BlobStorageType string

type GCPBlob

type GCPBlob struct {
}

func (*GCPBlob) DownloadBlob

func (impl *GCPBlob) DownloadBlob(request *BlobStorageRequest, file *os.File) (bool, int64, error)

func (*GCPBlob) UploadBlob

func (impl *GCPBlob) UploadBlob(request *BlobStorageRequest) error

type GcpBlobBaseConfig

type GcpBlobBaseConfig struct {
	BucketName             string `json:"bucketName"`
	CredentialFileJsonData string `json:"credentialFileData"`
}

type GcpBlobConfig

type GcpBlobConfig struct {
	CredentialFileJsonData string `json:"credentialFileData"`
	CacheBucketName        string `json:"ciCacheBucketName"`
	LogBucketName          string `json:"logBucketName"`
	ArtifactBucketName     string `json:"artifactBucketName"`
}

Jump to

Keyboard shortcuts

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