Documentation ¶
Overview ¶
Package config defines the Cloudinary configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v1.0.0
type API struct { UploadPrefix string `schema:"upload_prefix" default:"https://api.cloudinary.com"` Timeout int64 `schema:"timeout" default:"60"` // seconds UploadTimeout int64 `schema:"upload_timeout"` ChunkSize int64 `schema:"chunk_size" default:"20000000"` // bytes }
API defines the configuration for making requests to the Cloudinary API.
type AuthToken ¶ added in v1.2.0
type AuthToken struct { Key string `schema:"key"` IP string `schema:"ip"` ACL string `schema:"acl"` StartTime int64 `schema:"start_time"` Expiration int64 `schema:"expiration"` Duration int64 `schema:"duration"` }
AuthToken defines the configuration for delivering token-based authenticated media assets.
type Cloud ¶ added in v1.0.0
type Cloud struct { CloudName string `schema:"-"` APIKey string `schema:"-"` APISecret string `schema:"-"` SignatureAlgorithm string `schema:"signature_algorithm"` }
Cloud defines the cloud configuration required to connect your application to Cloudinary.
func (Cloud) GetSignatureAlgorithm ¶ added in v1.2.0
GetSignatureAlgorithm returns the signature algorithm.
type Configuration ¶
Configuration is the main configuration struct.
func New ¶ added in v1.0.0
func New() (*Configuration, error)
New returns a new Configuration instance from the environment variable
func NewFromParams ¶ added in v1.0.0
func NewFromParams(cloud string, key string, secret string) (*Configuration, error)
NewFromParams returns a new Configuration instance from the provided parameters.
func NewFromQueryParams ¶ added in v1.3.0
func NewFromQueryParams(cloud string, key string, secret string, params map[string][]string) (*Configuration, error)
NewFromQueryParams returns a new Configuration instance from the provided url query parameters.
func NewFromURL ¶ added in v1.0.0
func NewFromURL(cldURLStr string) (*Configuration, error)
NewFromURL returns a new Configuration instance from a cloudinary url.
type URL ¶ added in v1.2.0
type URL struct { Domain string `schema:"-" default:"cloudinary.com"` SubDomain string `schema:"-" default:"res"` CName string `schema:"cname"` SecureCName string `schema:"secure_cname"` Secure bool `schema:"secure" default:"true"` CDNSubDomain bool `schema:"cdn_sub_domain"` SecureCDNSubDomain bool `schema:"secure_cdn_sub_domain"` PrivateCDN bool `schema:"private_cdn"` SignURL bool `schema:"sign_url"` LongURLSignature bool `schema:"long_url_signature"` Shorten bool `schema:"shorten"` UseRootPath bool `schema:"use_root_path"` ForceVersion bool `schema:"force_version" default:"true"` Analytics bool `schema:"analytics" default:"true"` }
URL defines the configuration applied when generating Cloudinary URLs.
func (URL) GetSignatureLength ¶ added in v1.2.0
GetSignatureLength returns the length of the URL signature.