Documentation ¶
Index ¶
- type GCloudStorage
- func (s *GCloudStorage) Delete(ctx context.Context, image string) error
- func (s *GCloudStorage) Get(r *http.Request, image string) (imageData *imagor.Blob, err error)
- func (s *GCloudStorage) Path(image string) (string, bool)
- func (s *GCloudStorage) Put(ctx context.Context, image string, blob *imagor.Blob) (err error)
- func (s *GCloudStorage) Stat(ctx context.Context, image string) (stat *imagor.Stat, err error)
- type Option
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 ¶ added in v0.9.6
func (s *GCloudStorage) Delete(ctx context.Context, image string) error
Delete implements imagor.Storage interface
func (*GCloudStorage) Path ¶
func (s *GCloudStorage) Path(image string) (string, bool)
Path transforms and validates image key for storage path
type Option ¶
type Option func(h *GCloudStorage)
Option GCloudStorage option
func WithACL ¶
WithACL with ACL option https://cloud.google.com/storage/docs/json_api/v1/objects/insert
func WithExpiration ¶
WithExpiration with modified time expiration option
func WithPathPrefix ¶
WithPathPrefix with path prefix option
Click to show internal directories.
Click to hide internal directories.