mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 03:25:32 +00:00
18 lines
394 B
Go
Executable File
18 lines
394 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/micro/services/clients/go/currency"
|
|
"os"
|
|
)
|
|
|
|
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
|
|
func ConvertUsdToGbp() {
|
|
currencyService := currency.NewCurrencyService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := currencyService.Convert(¤cy.ConvertRequest{
|
|
From: "USD",
|
|
To: "GBP",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|