Documentation ¶
Index ¶
- Constants
- Variables
- func ClientError(status int, body string) (events.APIGatewayProxyResponse, error)
- func GetDbTableName(table string) string
- func GetRandString(length int) string
- func LoadEnvConfig() error
- func ServerError(err error) (events.APIGatewayProxyResponse, error)
- type SlashCommand
- type SmsMessage
Constants ¶
View Source
const CmdSms = "/sms"
View Source
const DynamoDBTableName = "reminderbot_queue"
Variables ¶
View Source
var Client *slack.Client
View Source
var Env envConfig
Log errors to stderr
Functions ¶
func ClientError ¶
func ClientError(status int, body string) (events.APIGatewayProxyResponse, error)
Similarly add a helper for send responses relating to client errors.
func GetDbTableName ¶
GetTableName returns the env var value of the string passed in or the string itself
func GetRandString ¶
GetRandString returns a random string of given length
func LoadEnvConfig ¶
func LoadEnvConfig() error
func ServerError ¶
func ServerError(err error) (events.APIGatewayProxyResponse, error)
Add a helper for handling errors. This logs any error to os.Stderr and returns a 500 Internal Server Error response that the AWS API Gateway understands.
Types ¶
type SlashCommand ¶
type SlashCommand struct { Token string `json:"token"` TeamID string `json:"team_id"` TeamDomain string `json:"team_domain"` EnterpriseID string `json:"enterprise_id,omitempty"` EnterpriseName string `json:"enterprise_name,omitempty"` ChannelID string `json:"channel_id"` ChannelName string `json:"channel_name"` UserID string `json:"user_id"` UserName string `json:"user_name"` Command string `json:"command"` Text string `json:"text"` ResponseURL string `json:"response_url"` TriggerID string `json:"trigger_id"` }
SlashCommand contains information about a request of the slash command
func SlashCommandParse ¶
func SlashCommandParse(r *http.Request) (s SlashCommand, err error)
SlashCommandParse will parse the request of the slash command
func (SlashCommand) ValidateToken ¶
func (s SlashCommand) ValidateToken(verificationTokens ...string) bool
ValidateToken validates verificationTokens
Click to show internal directories.
Click to hide internal directories.