remotestorage

package
v0.0.0-...-4c8e30b Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

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

Jump to

Keyboard shortcuts

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