示例#1
0
文件: aliyun.go 项目: nilslice/qor
func getBucket(option *media_library.Option) string {
	if bucket := option.Get("bucket"); bucket != "" {
		return bucket
	}

	return config.AliOSSBucket
}
示例#2
0
文件: s3.go 项目: JosephBuchma/qor
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
0
文件: s3.go 项目: JosephBuchma/qor
func getEndpoint(option *media_library.Option) string {
	if endpoint := option.Get("endpoint"); endpoint != "" {
		return endpoint
	}

	return getBucket(option) + "." + *S3Client.Config.Endpoint
}
示例#4
0
文件: aliyun.go 项目: nilslice/qor
func getEndpoint(option *media_library.Option) string {
	if endpoint := option.Get("endpoint"); endpoint != "" {
		return endpoint
	}
	return getBucket(option) + "." + config.AliOSSRegion
}
示例#5
0
文件: s3.go 项目: JosephBuchma/qor
func getBucket(option *media_library.Option) string {
	if bucket := os.Getenv("S3Bucket"); bucket != "" {
		return bucket
	}
	return option.Get("bucket")
}
示例#6
0
文件: qiniu.go 项目: nilslice/qor
func getEndpoint(option *media_library.Option) string {
	if endpoint := option.Get("endpoint"); endpoint != "" {
		return endpoint
	}
	return EndPoint + "/@"
}