mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 19:25:16 +00:00
19 lines
490 B
Go
Executable File
19 lines
490 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/micro/services/clients/go/image"
|
|
"os"
|
|
)
|
|
|
|
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
|
// To resize an image before uploading, see the Resize endpoint.
|
|
func UploadAnImageFromAurlToMicrosCdn() {
|
|
imageService := image.NewImageService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := imageService.Upload(&image.UploadRequest{
|
|
Name: "cat.jpeg",
|
|
Url: "somewebsite.com/cat.png",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|