Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-22 15:56:13 +00:00
parent 41076ed778
commit b386520a82
36 changed files with 1755 additions and 1707 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{
Messages: 10,
Name: "John",
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}