slack

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseText

func ResponseText(responseURL, text string) error

func SecretsVerifier

func SecretsVerifier(header http.Header, body []byte, secret string) error

Types

type SlashChannel

type SlashChannel struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

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"`
	APIAppID       string `json:"api_app_id"`
}

SlashCommand contains information about a request of the slash command

func SlashCommandParse

func SlashCommandParse(r *fasthttp.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

type SlashMessage

type SlashMessage struct {
	ClientMsgID string `json:"client_msg_id"`
	Type        string `json:"type"`
	Text        string `json:"text"`
	User        string `json:"user"`
	Ts          string `json:"ts"`
	Team        string `json:"team"`
}

type SlashShortcut

type SlashShortcut struct {
	Token       string       `json:"token"`
	Type        string       `json:"type"`
	ActionTs    string       `json:"action_ts"`
	Team        SlashTeam    `json:"team,omitempty"`
	User        SlashUser    `json:"user,omitempty"`
	CallbackID  string       `json:"callback_id"`
	TriggerID   string       `json:"trigger_id"`
	Channel     SlashChannel `json:"channel,omitempty"`
	ResponseURL string       `json:"response_url"`
	MessageTs   string       `json:"message_ts"`
	Message     SlashMessage `json:"message"`
}

SlashShortcut contains information about a request of the slash command

func SlashShortcutParse

func SlashShortcutParse(r *fasthttp.Request) (s SlashShortcut, err error)

SlashShortcutParse will parse the request of the slash command

func (SlashShortcut) ValidateToken

func (s SlashShortcut) ValidateToken(verificationTokens ...string) bool

ValidateToken validates verificationTokens

type SlashTeam

type SlashTeam struct {
	ID     string `json:"id"`
	Domain string `json:"domain"`
}

type SlashUser

type SlashUser struct {
	ID       string `json:"id"`
	Username string `json:"username"`
	TeamID   string `json:"team_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL