Files
services/examples/crypto/price/go/getCryptocurrencyPrice.go
2021-09-16 12:52:36 +01:00

17 lines
345 B
Go
Executable File

package example
import (
"fmt"
"github.com/micro/services/clients/go/crypto"
"os"
)
// Get the last price for a given crypto ticker
func GetCryptocurrencyPrice() {
cryptoService := crypto.NewCryptoService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := cryptoService.Price(&crypto.PriceRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}