mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-17 13:04:50 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -16,6 +16,15 @@ type StreamService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
// 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 (t *StreamService) CreateChannel(request *CreateChannelRequest) (*CreateChannelResponse, error) {
|
||||
|
||||
rsp := &CreateChannelResponse{}
|
||||
return rsp, t.client.Call("stream", "CreateChannel", request, rsp)
|
||||
|
||||
}
|
||||
|
||||
// List all the active channels
|
||||
func (t *StreamService) ListChannels(request *ListChannelsRequest) (*ListChannelsResponse, error) {
|
||||
|
||||
@@ -41,12 +50,24 @@ func (t *StreamService) SendMessage(request *SendMessageRequest) (*SendMessageRe
|
||||
}
|
||||
|
||||
type Channel struct {
|
||||
// description for the channel
|
||||
Description string `json:"description"`
|
||||
// last activity time
|
||||
LastActive string `json:"lastActive"`
|
||||
// name of the channel
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type CreateChannelRequest struct {
|
||||
// description for the channel
|
||||
Description string `json:"description"`
|
||||
// name of the channel
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type CreateChannelResponse struct {
|
||||
}
|
||||
|
||||
type ListChannelsRequest struct {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user