Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-11-08 10:59:15 +00:00
parent cab87b9b3e
commit d0307610bc
46 changed files with 1183 additions and 995 deletions

View File

@@ -4,6 +4,33 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Stream/api](ht
Endpoints:
## ListChannels
List all the active channels
[https://m3o.com/stream/api#ListChannels](https://m3o.com/stream/api#ListChannels)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/stream"
)
// List all the active channels
func ListChannels() {
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
rsp, err := streamService.ListChannels(&stream.ListChannelsRequest{
})
fmt.Println(rsp, err)
}
```
## CreateChannel
Create a channel with a given name and description. Channels are created automatically but
@@ -32,6 +59,7 @@ Name: "general",
})
fmt.Println(rsp, err)
}
```
## SendMessage
@@ -60,6 +88,7 @@ Text: "Hey checkout this tweet https://twitter.com/m3oservices/status/1455291054
})
fmt.Println(rsp, err)
}
```
## ListMessages
@@ -87,31 +116,6 @@ func ListMessages() {
})
fmt.Println(rsp, err)
}
```
## ListChannels
List all the active channels
[https://m3o.com/stream/api#ListChannels](https://m3o.com/stream/api#ListChannels)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/stream"
)
// List all the active channels
func ListChannels() {
streamService := stream.NewStreamService(os.Getenv("M3O_API_TOKEN"))
rsp, err := streamService.ListChannels(&stream.ListChannelsRequest{
})
fmt.Println(rsp, err)
}
```