storage

package
v0.0.0-...-a7f85cb Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Bucket string `env:"BUCKET,required"`
}

func (*Storage) Init

func (s *Storage) Init() error

Init the environment and set up the relevant variables in order to run seamlessly.

func (*Storage) Upload

func (s *Storage) Upload(ctx context.Context, file string, bucket *blob.Bucket, key string) error

UploadFile to the given bucket by where file is the local path and key is the desired remote path in the bucket.

func (*Storage) UploadFiles

func (s *Storage) UploadFiles(ctx context.Context, files []UploadFile) error

Upload puts the wanted files given by the map between local and remote paths into the bucket that was defined by `Bucket`.

type UploadFile

type UploadFile struct {
	Source string
	Key    string
}

Jump to

Keyboard shortcuts

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