gcloudstorage

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCloudStorage

type GCloudStorage struct {
	BaseDir    string
	PathPrefix string
	ACL        string
	SafeChars  string
	Expiration time.Duration

	Bucket string
	// contains filtered or unexported fields
}

GCloudStorage Google Cloud Storage implements imagor.Storage interface

func New

func New(client *storage.Client, bucket string, options ...Option) *GCloudStorage

New creates GCloudStorage

func (*GCloudStorage) Delete

func (s *GCloudStorage) Delete(ctx context.Context, image string) error

Delete implements imagor.Storage interface

func (*GCloudStorage) Get

func (s *GCloudStorage) Get(r *http.Request, image string) (imageData *imagor.Blob, err error)

Get implements imagor.Storage interface

func (*GCloudStorage) Path

func (s *GCloudStorage) Path(image string) (string, bool)

Path transforms and validates image key for storage path

func (*GCloudStorage) Put

func (s *GCloudStorage) Put(ctx context.Context, image string, blob *imagor.Blob) (err error)

Put implements imagor.Storage interface

func (*GCloudStorage) Stat

func (s *GCloudStorage) Stat(ctx context.Context, image string) (stat *imagor.Stat, err error)

Stat implements imagor.Storage interface

type Option

type Option func(h *GCloudStorage)

Option GCloudStorage option

func WithBaseDir

func WithBaseDir(baseDir string) Option

WithBaseDir with base dir option

func WithExpiration

func WithExpiration(exp time.Duration) Option

WithExpiration with modified time expiration option

func WithPathPrefix

func WithPathPrefix(prefix string) Option

WithPathPrefix with path prefix option

func WithSafeChars

func WithSafeChars(chars string) Option

WithSafeChars with safe chars option

Jump to

Keyboard shortcuts

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