本文整理匯總了Golang中github.com/qor/media_library.Option.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang Option.Get方法的具體用法?Golang Option.Get怎麽用?Golang Option.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/qor/media_library.Option
的用法示例。
在下文中一共展示了Option.Get方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getBucket
func getBucket(option *media_library.Option) string {
if bucket := option.Get("bucket"); bucket != "" {
return bucket
}
return Bucket
}
示例2: GetURLTemplate
func (s S3) GetURLTemplate(option *media_library.Option) (path string) {
if path = option.Get("URL"); path == "" {
path = "/{{class}}/{{primary_key}}/{{column}}/{{filename_with_hash}}"
}
return "//" + getEndpoint(option) + path
}
示例3: getEndpoint
func getEndpoint(option *media_library.Option) string {
if endpoint := option.Get("endpoint"); endpoint != "" {
return endpoint
}
return getBucket(option) + "." + *S3Client.Config.Endpoint
}
示例4: GetURLTemplate
// GetURLTemplate get url template
func (s CloudFront) GetURLTemplate(option *media_library.Option) (path string) {
if path = option.Get("URL"); path == "" {
path = "/{{class}}/{{primary_key}}/{{column}}/{{filename_with_hash}}"
}
if awsCloudFontDomain != "" {
return awsCloudFontDomain + path
}
return "//" + getEndpoint(option) + path
}
示例5: getEndpoint
func getEndpoint(option *media_library.Option) string {
if endpoint := option.Get("endpoint"); endpoint != "" {
return endpoint
}
endpoint := s3client().Endpoint
for _, prefix := range []string{"https://", "http://"} {
endpoint = strings.TrimPrefix(endpoint, prefix)
}
return getBucket(option) + "." + endpoint
}
示例6: getEndpoint
func getEndpoint(option *media_library.Option) string {
if endpoint := option.Get("endpoint"); endpoint != "" {
return endpoint
}
return EndPoint + "/@"
}
示例7: getEndpoint
func getEndpoint(option *media_library.Option) string {
if endpoint := option.Get("endpoint"); endpoint != "" {
return endpoint
}
return getBucket(option) + "." + config.AliOSSRegion
}