mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 19:45:26 +00:00
18 lines
341 B
Go
Executable File
18 lines
341 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/micro/services/clients/go/stream"
|
|
)
|
|
|
|
// List messages for a given channel
|
|
func ListMessages() {
|
|
streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := streamService.ListMessages(&stream.ListMessagesRequest{
|
|
Channel: "general",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|