Documentation ¶
Index ¶
- Constants
- func AvailableImageSize(width int64, height int64) (isAvailable bool)
- func GetImageDimensions(imageSize string) (width int64, height int64, isValid bool, err error)
- type FileData
- type GCSSetup
- type PresignUploadConfig
- type S3Setup
- type StorageBase
- func (base *StorageBase) GetFiles(storageType, storagePath, filename string) (files *os.File, err error)
- func (base *StorageBase) PreSignGetFiles(storageType, storagePath, filename string) (presignUrl string, err error)
- func (base *StorageBase) PresignUploadFiles(presignConfig PresignUploadConfig) (formData interface{}, err error)
- func (base *StorageBase) SetAwsS3(s3Setup *S3Setup) *StorageBase
- func (base *StorageBase) SetGoogleGCS(gcsSetup *GCSSetup) *StorageBase
- func (base *StorageBase) UploadFiles() (storageModel *StorageData, err error)
- type StorageData
Constants ¶
View Source
const ContentTypeGIF = "image/gif"
View Source
const ContentTypeJPEG = "image/jpeg"
View Source
const ContentTypeJPG = "image/jpg"
View Source
const ContentTypeJXL = "image/jxl"
View Source
const ContentTypePNG = "image/png"
image content type
Variables ¶
This section is empty.
Functions ¶
func AvailableImageSize ¶
Types ¶
type PresignUploadConfig ¶ added in v1.2.0
type StorageBase ¶
type StorageBase struct { // NonScaledTypes // if images not in this type, then file will be scaled // if images in this type, then file will not be scaled NonScaledTypes string // contains filtered or unexported fields }
func NewStorageBase ¶
func NewStorageBase(fileHeader *multipart.FileHeader, fileType string) *StorageBase
func (*StorageBase) GetFiles ¶
func (base *StorageBase) GetFiles(storageType, storagePath, filename string) (files *os.File, err error)
func (*StorageBase) PreSignGetFiles ¶ added in v1.2.0
func (base *StorageBase) PreSignGetFiles(storageType, storagePath, filename string) (presignUrl string, err error)
func (*StorageBase) PresignUploadFiles ¶ added in v1.2.0
func (base *StorageBase) PresignUploadFiles(presignConfig PresignUploadConfig) (formData interface{}, err error)
func (*StorageBase) SetAwsS3 ¶
func (base *StorageBase) SetAwsS3(s3Setup *S3Setup) *StorageBase
func (*StorageBase) SetGoogleGCS ¶
func (base *StorageBase) SetGoogleGCS(gcsSetup *GCSSetup) *StorageBase
func (*StorageBase) UploadFiles ¶
func (base *StorageBase) UploadFiles() (storageModel *StorageData, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.