Documentation

Overview

Package remotestorage wraps cloud storage API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleCloudStorage

type GoogleCloudStorage struct {
	JSONKey []byte
	Project string
	Config  *jwt.Config
	// contains filtered or unexported fields
}

GoogleCloudStorage wraps Google Cloud Storage API.

func (*GoogleCloudStorage) UploadDir

func (g *GoogleCloudStorage) UploadDir(bucket, src, dst string, opts ...OpOption) error

UploadDir uploads a directory to Google Cloud Storage.

func (*GoogleCloudStorage) UploadFile

func (g *GoogleCloudStorage) UploadFile(bucket, src, dst string, opts ...OpOption) error

UploadFile uploads a file to Google Cloud Storage.

type Op

type Op struct {
	ContentType string
}

type OpOption

type OpOption func(*Op)

func WithContentType

func WithContentType(t string) OpOption

type Uploader

type Uploader interface {
	// UploadFile uploads a file.
	UploadFile(bucket, src, dst string, opts ...OpOption) error

	// UploadDir uploads a directory.
	UploadDir(bucket, src, dst string, opts ...OpOption) error
}

Uploader defines storage uploader.

func NewGoogleCloudStorage

func NewGoogleCloudStorage(lg *zap.Logger, key []byte, project string) (Uploader, error)

NewGoogleCloudStorage creates a new uploader.

Directories

Path Synopsis
example