storage

package module
v0.0.0-...-07818df Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(object string) error

Delete deletes a file in Cloud Storage.

func Download

func Download(object string) (string, error)

Download downloads a file from Cloud Storage and saves it to /tmp.

func MakeTempFile

func MakeTempFile(fileBytes []byte, fileName string) (string, error)

MakeTempFile creates a temp file in /tmp for processing. Returns the temp file name and error.

func Upload

func Upload(file io.Reader, fileName string) error

Upload uploads a file to Cloud Storage.

Types

type DownloadObject

type DownloadObject struct {
	ContentType string
	Size        string
	Content     []byte
}

DownloadObject represents the downloaded object from Cloud Storage that will be served in the browser.

func DownloadFromCloudStorage

func DownloadFromCloudStorage(object string) (DownloadObject, error)

DownloadFromCloudStorage downloads a file from Cloud Storage ready to be served directly in the browser.

Jump to

Keyboard shortcuts

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