mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 19:25:16 +00:00
20 lines
544 B
Go
Executable File
20 lines
544 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/micro/services/clients/go/stream"
|
|
)
|
|
|
|
// Create a channel with a given name and description. Channels are created automatically but
|
|
// this allows you to specify a description that's persisted for the lifetime of the channel.
|
|
func CreateChannel() {
|
|
streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := streamService.CreateChannel(&stream.CreateChannelRequest{
|
|
Description: "The channel for all things",
|
|
Name: "general",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|