mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-14 20:14:47 +00:00
15 lines
314 B
Go
Executable File
15 lines
314 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/micro/services/clients/go/url"
|
|
"os"
|
|
)
|
|
|
|
// Shortens a destination URL and returns a full short URL.
|
|
func ShortenAlongUrl() {
|
|
urlService := url.NewUrlService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := urlService.Shorten(&url.ShortenRequest{})
|
|
fmt.Println(rsp, err)
|
|
}
|