cloudinary

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPublicID

func ExtractPublicID(url string) string

ExtractPublicID extracts the public ID from a Cloudinary URL Example: https://res.cloudinary.com/demo/image/upload/v1234567890/products/sample.jpg Returns: products/sample

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the Cloudinary client

func NewClient

func NewClient() (*Client, error)

NewClient creates a new Cloudinary client The CLOUDINARY_URL environment variable should be set in the format: cloudinary://API_KEY:API_SECRET@CLOUD_NAME

func (*Client) DeleteImage

func (c *Client) DeleteImage(publicID string) error

DeleteImage deletes an image from Cloudinary by public ID

func (*Client) UploadImage

func (c *Client) UploadImage(file multipart.File, filename string, folder string) (string, error)

UploadImage uploads an image file to Cloudinary Returns the secure URL of the uploaded image

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL