storage

package
v0.0.78 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultBucketName                          = "terrarium-modules"
	DefaultStorageServiceDefaultEndpoint       = "storage:3001"
	DefaultChunkSize                     int64 = 64 * 1024 // 64 KB
)

Variables

View Source
var (
	BucketName             = DefaultBucketName
	StorageServiceEndpoint = DefaultStorageServiceDefaultEndpoint
	ChunkSize              = DefaultChunkSize

	SourceZipUploaded = &terrarium.Response{Message: "Source zip uploaded successfully."}

	BucketInitializationError = status.Error(codes.Unknown, "Failed to initialize bucket for storage.")
	UploadSourceZipError      = status.Error(codes.Unknown, "Failed to upload source zip.")
	RecieveSourceZipError     = status.Error(codes.Unknown, "Failed to recieve source zip.")
	DownloadSourceZipError    = status.Error(codes.Unknown, "Failed to download source zip.")
	SendSourceZipError        = status.Error(codes.Unknown, "Failed to send source zip.")
	ContentLenghtError        = status.Error(codes.Unknown, "Failed to read correct content lenght.")
)

Functions

func NewStorageGrpcClient added in v0.0.67

func NewStorageGrpcClient(endpoint string) services.StorageClient

Types

type StorageService

type StorageService struct {
	services.UnimplementedStorageServer
	Client     storage.AWSS3BucketClient
	BucketName string
	Region     string
}

func (*StorageService) DownloadSourceZip

Download Source Zip from storage

func (*StorageService) RegisterWithServer

func (s *StorageService) RegisterWithServer(grpcServer grpc.ServiceRegistrar) error

Registers StorageService with grpc server

func (*StorageService) UploadSourceZip

func (s *StorageService) UploadSourceZip(server services.Storage_UploadSourceZipServer) error

Upload Source Zip to storage

Jump to

Keyboard shortcuts

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