Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-11-03 17:03:09 +00:00
parent 611202c283
commit 5963caaa3f
16 changed files with 541 additions and 510 deletions

View File

@@ -0,0 +1,31 @@
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)
}
}