uploads

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BucketNameBase                = "healthcloud_bewell_api_gateway_uploads"
	BucketLocation                = "EU"
	UploadFirestoreCollectionName = "uploads"
)

Constants used to save and retrieve upload content

Variables

This section is empty.

Functions

func GCSClient

func GCSClient(ctx context.Context) (*storage.Client, error)

GCSClient initializes a new Google Cloud Storage client and ensures that the bucket(s) we need exists

Types

type ServiceUploadImpl

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

ServiceUploadImpl is an upload service

func NewUploadsService

func NewUploadsService() *ServiceUploadImpl

NewUploadsService initializes an upload service

func (ServiceUploadImpl) FindUploadByID

func (s ServiceUploadImpl) FindUploadByID(
	ctx context.Context,
	id string,
) (*profileutils.Upload, error)

FindUploadByID retrieves an upload by it's ID

func (ServiceUploadImpl) FirestoreClient

func (s ServiceUploadImpl) FirestoreClient() *firestore.Client

FirestoreClient returns the upload service's Firebase Firestore client

func (ServiceUploadImpl) StorageClient

func (s ServiceUploadImpl) StorageClient() *storage.Client

StorageClient returns the upload service's Google Cloud Storage Client

func (ServiceUploadImpl) Upload

Upload uploads the file to cloud storage

type ServiceUploads

type ServiceUploads interface {
	Upload(
		ctx context.Context,
		inp profileutils.UploadInput,
	) (*profileutils.Upload, error)

	FindUploadByID(
		ctx context.Context,
		id string,
	) (*profileutils.Upload, error)
}

ServiceUploads ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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