gcloud

package
v0.0.0-...-1e80c8a Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleCloudFileContentRepo

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

GoogleCloudFileContentRepo ...

func NewFileContentRepo

func NewFileContentRepo(storage *Storage, bucket string) *GoogleCloudFileContentRepo

NewFileContentRepo ...

func (*GoogleCloudFileContentRepo) Download

func (repo *GoogleCloudFileContentRepo) Download(ctx context.Context, dbFile *model.DBFile) ([]byte, error)

Download file from Google Cloud storage

func (*GoogleCloudFileContentRepo) Upload

func (repo *GoogleCloudFileContentRepo) Upload(ctx context.Context, dbFile *model.DBFile, fileBody []byte) error

Upload file to Google Cloud storage

type Storage

type Storage struct {
	*storage.Client
}

Storage is a wrapper for Google Cloud storage client

func Init

func Init(ctx context.Context) (*Storage, error)

Init creates new cloud storage client

Jump to

Keyboard shortcuts

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