本文整理汇总了Golang中github.com/qor/media_library.Option类的典型用法代码示例。如果您正苦于以下问题:Golang Option类的具体用法?Golang Option怎么用?Golang Option使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Option类的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
}