Documentation
¶
Overview ¶
Package api contains packages used for accessing Cloudinary API functionality.
Index ¶
- Constants
- func BaseURL(uploadPrefix string) string
- func BuildPath(parts ...interface{}) string
- func DeferredClose(c io.Closer)
- func IsBase64Data(base64Candidate string) bool
- func IsLocalFilePath(path interface{}) bool
- func IsValidURL(urlCandidate string) bool
- func SignParameters(params url.Values, secret string) (string, error)
- func StructToParams(inputStruct interface{}) (url.Values, error)
- type AssetType
- type BriefAssetResult
- type CldAPIArray
- type CldAPIMap
- type Coordinates
- type DeliveryType
- type EndPoint
- type ErrorResp
- type Metadata
- type ModerationStatus
- type Option
Constants ¶
const ( // Image is the image asset type. Image AssetType = "image" // Video is the video asset type. Video = "video" // File is the raw asset type. File = "raw" // Auto is the auto asset type. Tells Cloudinary to automatically detect the type of the uploaded asset. Auto = "auto" // All is the all asset type. Used for downloading folders with all assets inside. All = "all" )
const ( // Upload is the upload delivery type. Upload DeliveryType = "upload" // Private is the private delivery type. Private = "private" // Public is the delivery type. Public = "public" // Authenticated is the delivery type. Authenticated = "authenticated" // Fetch is the fetch delivery type. Fetch = "fetch" // Sprite is the sprite delivery type. Sprite = "sprite" // Text is the text delivery type. Text = "text" // Multi is the multi delivery type. Multi = "multi" // Facebook is the facebook delivery type. Facebook = "facebook" // Twitter is the twitter delivery type. Twitter = "twitter" // TwitterName is the twitter name delivery type. TwitterName = "twitter_name" // Gravatar is the gravatar delivery type. Gravatar = "gravatar" // Youtube is the youtube delivery type. Youtube = "youtube" // Hulu is the hulu delivery type. Hulu = "hulu" // Vimeo is the vimeo delivery type. Vimeo = "vimeo" // Animoto is the animoto delivery type. Animoto = "animoto" // Worldstarhiphop is the world star hip hop delivery type. Worldstarhiphop = "worldstarhiphop" // Dailymotion is the daily motion delivery type. Dailymotion = "dailymotion" )
const ( // Pending is the pending moderation status. Pending ModerationStatus = "pending" // Approved is the approved moderation status. Approved = "approved" // Rejected is the rejected moderation status. Rejected = "rejected" )
const UserAgent = "CloudinaryGo/" + Version
UserAgent contains information about the SDK user agent. Passed to the Cloudinary servers.
const Version = "1.0.0"
Version is the Cloudinary Go package version.
Variables ¶
This section is empty.
Functions ¶
func BuildPath ¶
func BuildPath(parts ...interface{}) string
BuildPath builds (joins) the URL path from the provided parts.
func DeferredClose ¶
DeferredClose is a wrapper around io.Closer.Close method. Logs error if occurred.
func IsBase64Data ¶
IsBase64Data checks whether base64Candidate represents a valid base64 encoded string.
func IsLocalFilePath ¶
func IsLocalFilePath(path interface{}) bool
IsLocalFilePath determines whether the provided path can be a local file.
Since a unix file path can include almost any characters, the way to distinguish between file path and non-file path is to check if it can be URL or Base64 encoded data.
func IsValidURL ¶
IsValidURL checks whether urlCandidate string is a valid URL.
func SignParameters ¶
SignParameters signs parameters using the provided secret.
func StructToParams ¶
StructToParams serializes struct to url.Values, which can be further sent to the http client.
Types ¶
type BriefAssetResult ¶
type BriefAssetResult struct { AssetID string `json:"asset_id"` PublicID string `json:"public_id"` Format string `json:"format"` Version int `json:"version"` AssetType string `json:"resource_type"` Type string `json:"type"` CreatedAt time.Time `json:"created_at"` Bytes int `json:"bytes"` Width int `json:"width"` Height int `json:"height"` Backup bool `json:"backup"` AccessMode string `json:"access_mode"` URL string `json:"url"` SecureURL string `json:"secure_url"` Tags []string `json:"tags,omitempty"` Context CldAPIMap `json:"context,omitempty"` Metadata Metadata `json:"metadata,omitempty"` Placeholder bool `json:"placeholder,omitempty"` Error string `json:"error,omitempty"` }
BriefAssetResult represents a partial asset result that is returned when assets are listed.
type CldAPIArray ¶
type CldAPIArray []string
CldAPIArray is not just an alias, in addition it has a custom MarshalJSON() for serialisation purposes.
func (CldAPIArray) MarshalJSON ¶
func (cldAPIArr CldAPIArray) MarshalJSON() ([]byte, error)
MarshalJSON writes a quoted string in the custom format.
type CldAPIMap ¶
CldAPIMap is not just an alias, in addition it has a custom MarshalJSON() for serialisation purposes.
func (CldAPIMap) MarshalJSON ¶
MarshalJSON writes a quoted string in the custom format.
type DeliveryType ¶
type DeliveryType string
DeliveryType is the delivery type of the asset.
func (DeliveryType) String ¶
func (d DeliveryType) String() string
String serializes DeliveryType to string.
type ErrorResp ¶
type ErrorResp struct {
Message string `json:"message"`
}
ErrorResp is the failed api request main struct.
type Metadata ¶
type Metadata map[string]interface{}
Metadata is the Cloudinary structured metadata.
type ModerationStatus ¶
type ModerationStatus string
ModerationStatus is the moderation status of the asset.
Directories
¶
Path | Synopsis |
---|---|
Package admin is used for accessing Cloudinary Admin API functionality.
|
Package admin is used for accessing Cloudinary Admin API functionality. |
metadata
Package metadata defines the structured metadata.
|
Package metadata defines the structured metadata. |
Package uploader is used for accessing Cloudinary Upload API functionality.
|
Package uploader is used for accessing Cloudinary Upload API functionality. |