Versions in this module Expand all Collapse all v0 v0.16.0 Apr 28, 2023 Changes in this version + var ThumbSizeRegex = regexp.MustCompile(`^(\d+)x(\d+)(t|b|f)?$`) + type BytesReader struct + Bytes []byte + func (r *BytesReader) Open() (io.ReadSeekCloser, error) + type File struct + Name string + OriginalName string + Reader FileReader + Size int64 + func NewFileFromBytes(b []byte, name string) (*File, error) + func NewFileFromMultipart(mh *multipart.FileHeader) (*File, error) + func NewFileFromPath(path string) (*File, error) + type FileReader interface + Open func() (io.ReadSeekCloser, error) + type MultipartReader struct + Header *multipart.FileHeader + func (r *MultipartReader) Open() (io.ReadSeekCloser, error) + type PathReader struct + Path string + func (r *PathReader) Open() (io.ReadSeekCloser, error) + type System struct + func NewLocal(dirPath string) (*System, error) + func NewS3(bucketName string, region string, endpoint string, accessKey string, ...) (*System, error) + func (s *System) Attributes(fileKey string) (*blob.Attributes, error) + func (s *System) Close() error + func (s *System) CreateThumb(originalKey string, thumbKey, thumbSize string) error + func (s *System) Delete(fileKey string) error + func (s *System) DeletePrefix(prefix string) []error + func (s *System) Exists(fileKey string) (bool, error) + func (s *System) GetFile(fileKey string) (*blob.Reader, error) + func (s *System) Serve(res http.ResponseWriter, req *http.Request, fileKey string, name string) error + func (s *System) Upload(content []byte, fileKey string) error + func (s *System) UploadFile(file *File, fileKey string) error + func (s *System) UploadMultipart(fh *multipart.FileHeader, fileKey string) error