Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/autom8ter/cobraslack
create a slack slash command handler that executes a cobra command
https://github.com/autom8ter/cobraslack
cobra golang slack slack-bot
Last synced: about 18 hours ago
JSON representation
create a slack slash command handler that executes a cobra command
- Host: GitHub
- URL: https://github.com/autom8ter/cobraslack
- Owner: autom8ter
- Created: 2020-01-21T03:37:57.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-02T18:08:13.000Z (about 4 years ago)
- Last Synced: 2024-06-19T15:11:24.127Z (5 months ago)
- Topics: cobra, golang, slack, slack-bot
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cobraslack
--
import "."## Usage
#### func QueryHandler
```go
func QueryHandler(cmd *cobra.Command) http.HandlerFunc
```
QueryHandler returns an http handler that sets the arguments to the root cobra
command from the text of the 'text' query paramater the output of the cobra
command is written directly to the response body. example executing "echo -h"
subcommand: curl -X GET "$(host)/command?text=echo%20-h"#### func SlackHandler
```go
func SlackHandler(cmd *cobra.Command, verificationToken string) http.HandlerFunc
```
SlackHandler returns an http handler that sets the arguments to the root cobra
command from the text of the slash command the output of the cobra command is
written directly to the response body as a slack message. example executing
"echo -h" subcommand: curl -X POST "$(host)/command" --data "text=echo -h"