Files
services/examples/helloworld/stream/go/streamsResponsesFromTheServerUsingWebsockets.go

18 lines
396 B
Go
Executable File

package example
import (
"fmt"
"os"
"github.com/micro/services/clients/go/helloworld"
)
// Stream returns a stream of "Hello $name" responses
func StreamsResponsesFromTheServerUsingWebsockets() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := helloworldService.Stream(&helloworld.StreamRequest{
Name: "John",
})
fmt.Println(rsp, err)
}