mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-12 19:05:12 +00:00
32 lines
465 B
Go
Executable File
32 lines
465 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/helloworld"
|
|
)
|
|
|
|
// Stream returns a stream of "Hello $name" responses
|
|
func main() {
|
|
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN"))
|
|
|
|
stream, err := helloworldService.Stream(&helloworld.StreamRequest{
|
|
Name: "John",
|
|
})
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
|
|
for {
|
|
rsp, err := stream.Recv()
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
|
|
fmt.Println(rsp)
|
|
}
|
|
}
|