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 AssetType = "image" Video = "video" File = "raw" Auto = "auto" All = "all" )
const ( Upload DeliveryType = "upload" Private = "private" Public = "public" Authenticated = "authenticated" Fetch = "fetch" Sprite = "sprite" Text = "text" Multi = "multi" Facebook = "facebook" Twitter = "twitter" TwitterName = "twitter_name" Gravatar = "gravatar" Youtube = "youtube" Hulu = "hulu" Vimeo = "vimeo" Animoto = "animoto" Worldstarhiphop = "worldstarhiphop" Dailymotion = "dailymotion" )
const ( Pending ModerationStatus = "pending" Approved = "approved" Rejected = "rejected" )
const UserAgent = "CloudinaryGo/" + Version
const Version = "0.2.0"
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
func (CldApiArray) MarshalJSON ¶
func (cldApiArr CldApiArray) MarshalJSON() ([]byte, error)
MarshalJSON writes a quoted string in the custom format.
type CldApiMap ¶
func (CldApiMap) MarshalJSON ¶
MarshalJSON writes a quoted string in the custom format.
type Coordinates ¶
type Coordinates [][]int
type DeliveryType ¶
type DeliveryType string
func (DeliveryType) String ¶
func (d DeliveryType) String() string
type ErrorResp ¶
type ErrorResp struct {
Message string `json:"message"`
}
ErrorResp is the failed api request main struct.
type ModerationStatus ¶
type ModerationStatus string
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. |