Documentation ¶
Index ¶
- Variables
- func IsBadRequestError(err error) bool
- type SpacesURL
- type Storage
- func (s *Storage) BucketAndKey(link *url.URL) (bucket, key string, err error)
- func (s *Storage) GenerateGetURL(link *url.URL) (signedURL string, err error)
- func (s *Storage) GeneratePutURL(fileName, contentType string, contentLength int64) (signedURL, key string, err error)
- func (s *Storage) GetURL(key string) string
- func (s *Storage) RawSignedGetURL(key string) (signedURL string, err error)
- func (s *Storage) UploadB64Image(imageB64 *string) (key string, err error)
- func (s *Storage) ValidateImage(object *url.URL, id string) error
- type Storager
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrImageTooLarge = fmt.Errorf("too large image, must be not greater than %d bytes", maxImageSize) ErrIncorrectImageType = fmt.Errorf("incorrect object type, must be image/png or image/jpeg") ErrURLRegexp = fmt.Errorf("url don't match regexp") ErrInvalidBucket = fmt.Errorf("invalid bucket") ErrInvalidKey = fmt.Errorf("invalid key") ErrRegionMismatched = fmt.Errorf("aws datacenter region mismatched") )
Functions ¶
func IsBadRequestError ¶
Types ¶
type Storage ¶
type Storage struct { APIKey string // contains filtered or unexported fields }
func (*Storage) BucketAndKey ¶
func (*Storage) GenerateGetURL ¶
func (*Storage) GeneratePutURL ¶
func (*Storage) RawSignedGetURL ¶
func (*Storage) UploadB64Image ¶
Click to show internal directories.
Click to hide internal directories.