mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-22 06:45:17 +00:00
Update README.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# M3O Go Client
|
# M3O Go Client
|
||||||
|
|
||||||
By default the client connects to api.m3o.com/client
|
By default the client connects to api.m3o.com
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
@@ -35,7 +35,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
var rsp Response
|
var rsp Response
|
||||||
|
|
||||||
if err := c.Call("greeter", "Say.Hello", req, &rsp); err != nil {
|
if err := c.Call("helloworld", "call", req, &rsp); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ If you want to access your local micro:
|
|||||||
You can also set the api address explicitly:
|
You can also set the api address explicitly:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
c := client.NewClient(client.Options{Address: "https://api.yourdomain.com/client"})
|
c := client.NewClient(client.Options{Address: "https://api.yourdomain.com"})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Streaming
|
## Streaming
|
||||||
@@ -79,7 +79,7 @@ type Response struct {
|
|||||||
func main() {
|
func main() {
|
||||||
c := client.NewClient(&client.Options{Local: true})
|
c := client.NewClient(&client.Options{Local: true})
|
||||||
|
|
||||||
stream, err := c.Stream("example", "Streamer.ServerStream", Request{Count: "10"})
|
stream, err := c.Stream("streams", "subscribe", Request{Count: "10"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user