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

17 lines
328 B
Go
Executable File

package example
import (
"fmt"
"github.com/micro/services/clients/go/stock"
"os"
)
// Get the last price for a given stock ticker
func GetAstockPrice() {
stockService := stock.NewStockService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := stockService.Price(&stock.PriceRequest{
Symbol: "AAPL",
})
fmt.Println(rsp, err)
}