gcloudstorage

package
v0.8.22 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 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
	// contains filtered or unexported fields
}

func New

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

func (*GCloudStorage) Load

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

func (*GCloudStorage) Path

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

func (*GCloudStorage) Save

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

type Option

type Option func(h *GCloudStorage)

func WithACL

func WithACL(acl string) Option

func WithBaseDir

func WithBaseDir(baseDir string) Option

func WithExpiration

func WithExpiration(exp time.Duration) Option

func WithPathPrefix

func WithPathPrefix(prefix string) Option

func WithSafeChars

func WithSafeChars(chars string) Option

Jump to

Keyboard shortcuts

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