Documentation
¶
Overview ¶
Package config defines the Cloudinary configuration.
Index ¶
- type API
- type AuthToken
- type Cloud
- type Configuration
- func New() (*Configuration, error)
- func NewFromOAuthToken(cloud string, oAuthToken string) (*Configuration, error)
- func NewFromParams(cloud string, key string, secret string) (*Configuration, error)
- func NewFromQueryParams(cloud string, key string, secret string, params map[string][]string) (*Configuration, error)
- func NewFromURL(cldURLStr string) (*Configuration, error)
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
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 ¶
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 ¶
type Cloud struct {
CloudName string `schema:"-"`
APIKey string `schema:"-"`
APISecret string `schema:"-"`
OAuthToken string `schema:"oauth_token"`
SignatureAlgorithm string `schema:"signature_algorithm"`
}
Cloud defines the cloud configuration required to connect your application to Cloudinary.
func (Cloud) GetSignatureAlgorithm ¶
GetSignatureAlgorithm returns the signature algorithm.
type Configuration ¶
Configuration is the main configuration struct.
func New ¶
func New() (*Configuration, error)
New returns a new Configuration instance from the environment variable
func NewFromOAuthToken ¶
func NewFromOAuthToken(cloud string, oAuthToken string) (*Configuration, error)
NewFromOAuthToken returns a new Configuration instance from the provided cloud name and OAuth token.
func NewFromParams ¶
func NewFromParams(cloud string, key string, secret string) (*Configuration, error)
NewFromParams returns a new Configuration instance from the provided parameters.
func NewFromQueryParams ¶
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 ¶
func NewFromURL(cldURLStr string) (*Configuration, error)
NewFromURL returns a new Configuration instance from a cloudinary url.
type URL ¶
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 ¶
GetSignatureLength returns the length of the URL signature.