Documentation ¶
Index ¶
- func ExtractFromMap[K, V comparable](data, result map[K]V, fn func(value V) bool)
- func Filter[T comparable](data []T, fn func(v T) bool) []T
- func ForEach[T any](data []T, fn func(v T))
- func Map[T, V comparable](data []T, fn func(v T) V) []V
- type AssetUploadManager
- func (am *AssetUploadManager) DestroyAsset(ctx context.Context, publicId string, transformation string) (*uploader.DestroyResult, error)
- func (am *AssetUploadManager) TransformImage(ctx context.Context, publicId string, transformation string) (string, error)
- func (am *AssetUploadManager) UploadMultipleFiles(ctx context.Context, files ...interface{}) []FileUploadResult
- func (am *AssetUploadManager) UploadSingleFile(ctx context.Context, file interface{}) (*uploader.UploadResult, error)
- type FileUploadResult
- type Meta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFromMap ¶
func ExtractFromMap[K, V comparable](data, result map[K]V, fn func(value V) bool)
func Filter ¶
func Filter[T comparable](data []T, fn func(v T) bool) []T
func Map ¶
func Map[T, V comparable](data []T, fn func(v T) V) []V
Types ¶
type AssetUploadManager ¶
type AssetUploadManager struct { FileTypeSupported []string // supported file types MaxAssetSize int64 // maximum size for an asset MaxUploadTimeout time.Duration // maximum upload timeout for assets to be uploaded MaxNumberOfConcurrentUploads int64 // number of concurrent uploads Metadata Meta // metadata about asset upload management for this instance // contains filtered or unexported fields }
AssetUploadManager wraps around cloudinary upload package, increasing the number of uploads that can be performed concurrent and also ensures that files are uploaded to the correct location base on the mimetype of the file being uploaded
func NewAssetUploadManager ¶
func NewAssetUploadManager(cloudName string, apiKey string, apiSecret string) (*AssetUploadManager, error)
NewAssetUploadManager New creates a new asset uploader which will upload files and other supported assets to cloudinary server. Inorder, for this to work, you need to configure AssetUploadManager with the following configuration `cloudName`, `apikey`,and `apiSecret` for more information visit: https://cloudinary.com/documentation/
func (*AssetUploadManager) DestroyAsset ¶
func (am *AssetUploadManager) DestroyAsset(ctx context.Context, publicId string, transformation string) (*uploader.DestroyResult, error)
func (*AssetUploadManager) TransformImage ¶
func (am *AssetUploadManager) TransformImage(ctx context.Context, publicId string, transformation string) (string, error)
TransformImage is used to transform image property of a single file on a cloudinary server
func (*AssetUploadManager) UploadMultipleFiles ¶
func (am *AssetUploadManager) UploadMultipleFiles(ctx context.Context, files ...interface{}) []FileUploadResult
func (*AssetUploadManager) UploadSingleFile ¶
func (am *AssetUploadManager) UploadSingleFile(ctx context.Context, file interface{}) (*uploader.UploadResult, error)
UploadSingleFile is used to upload a single file to the server the file can either be a byte slice or a string
type FileUploadResult ¶
type FileUploadResult struct {
// contains filtered or unexported fields
}