From 6d6edbe311adf3e1949da46c5003169c3c290894 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 21 Apr 2021 16:06:06 +0100 Subject: [PATCH] Update README.md --- README.md | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 46f1897..0073921 100644 --- a/README.md +++ b/README.md @@ -43,18 +43,6 @@ func main() { } ``` -If you want to access your local micro: - -```go - c := client.NewClient(client.Options{Local: true}) -``` - -You can also set the api address explicitly: - -```go - c := client.NewClient(client.Options{Address: "https://api.yourdomain.com"}) -``` - ## Streaming The client supports streaming @@ -76,9 +64,16 @@ type Response struct { Count string `json:"count"` } -func main() { - c := client.NewClient(&client.Options{Local: true}) +var ( + token, _ = os.Getenv("TOKEN") +) +func main() { + c := client.NewClient(nil) + + // set your api token + c.SetToken(token) + stream, err := c.Stream("streams", "subscribe", Request{Count: "10"}) if err != nil { fmt.Println(err)