func getBucket(option *media_library.Option) string { if bucket := option.Get("bucket"); bucket != "" { return bucket } return config.AliOSSBucket }
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 }
func getEndpoint(option *media_library.Option) string { if endpoint := option.Get("endpoint"); endpoint != "" { return endpoint } return getBucket(option) + "." + *S3Client.Config.Endpoint }
func getEndpoint(option *media_library.Option) string { if endpoint := option.Get("endpoint"); endpoint != "" { return endpoint } return getBucket(option) + "." + config.AliOSSRegion }
func getBucket(option *media_library.Option) string { if bucket := os.Getenv("S3Bucket"); bucket != "" { return bucket } return option.Get("bucket") }
func getEndpoint(option *media_library.Option) string { if endpoint := option.Get("endpoint"); endpoint != "" { return endpoint } return EndPoint + "/@" }