api

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderContentType    = "Content-Type"
	HeaderSlackTimestamp = "X-Slack-Request-Timestamp"
	HeaderSlackSignature = "X-Slack-Signature"
	HeaderAuthorization  = "Authorization"

	ContentTypeForm            = "application/x-www-form-urlencoded"
	ContentTypeJSONCharsetUTF8 = "application/json; charset=utf-8"
	ContentTypeJSON            = "application/json"

	// Timeout for short-lived outbound HTTP POST requests.
	Timeout = 3 * time.Second
)

Variables

View Source
var OAuthTokenContextKey = ctxKey("OAuthTokenContext")

Functions

func PostForm

func PostForm(ctx context.Context, vars sdkservices.Vars, kv url.Values, resp any, slackMethod string) error

PostForm sends a short-lived HTTP POST request with an OAuth bearer token and URL-encoded key/value payload, and then receives and parses the JSON response.

func PostJSON

func PostJSON(ctx context.Context, vars sdkservices.Vars, req, resp any, slackMethod string) error

PostJSON sends a short-lived HTTP POST request with an OAuth bearer token and JSON payload, and then receives and parses the JSON response.

Types

type ResponseMetadata

type ResponseMetadata struct {
	Messages   []string `json:"messages,omitempty"`
	Warnings   []string `json:"warnings,omitempty"`
	NextCursor string   `json:"next_cursor,omitempty"`
}

type SlackResponse

type SlackResponse struct {
	OK               bool              `json:"ok"`
	Warning          string            `json:"warning,omitempty"`
	Error            string            `json:"error,omitempty"`
	ResponseMetadata *ResponseMetadata `json:"response_metadata,omitempty"`
}

Directories

Path Synopsis
Package apps is a lightweight wrapper over the "apps" methods in Slack's Web API: https://api.slack.com/methods?filter=apps.
Package apps is a lightweight wrapper over the "apps" methods in Slack's Web API: https://api.slack.com/methods?filter=apps.
Package auth is a lightweight wrapper over the "auth" methods in Slack's Web API: https://api.slack.com/methods?filter=auth.
Package auth is a lightweight wrapper over the "auth" methods in Slack's Web API: https://api.slack.com/methods?filter=auth.
Package bookmarks is a lightweight wrapper over the "bookmarks" methods in Slack's Web API: https://api.slack.com/methods?filter=bookmarks.
Package bookmarks is a lightweight wrapper over the "bookmarks" methods in Slack's Web API: https://api.slack.com/methods?filter=bookmarks.
Package bots is a lightweight wrapper over the "bots" methods in Slack's Web API: https://api.slack.com/methods?filter=bots.
Package bots is a lightweight wrapper over the "bots" methods in Slack's Web API: https://api.slack.com/methods?filter=bots.
Package chat is a lightweight wrapper over the "chat" methods in Slack's Web API: https://api.slack.com/methods?filter=chat.
Package chat is a lightweight wrapper over the "chat" methods in Slack's Web API: https://api.slack.com/methods?filter=chat.
Package conversations is a lightweight wrapper over the "conversations" methods in Slack's Web API: https://api.slack.com/methods?filter=conversations.
Package conversations is a lightweight wrapper over the "conversations" methods in Slack's Web API: https://api.slack.com/methods?filter=conversations.
Package reactions is a lightweight wrapper over the "reactions" methods in Slack's Web API: https://api.slack.com/methods?filter=reactions.
Package reactions is a lightweight wrapper over the "reactions" methods in Slack's Web API: https://api.slack.com/methods?filter=reactions.
Package users is a lightweight wrapper over the "users" methods in Slack's Web API: https://api.slack.com/methods?filter=users.
Package users is a lightweight wrapper over the "users" methods in Slack's Web API: https://api.slack.com/methods?filter=users.

Jump to

Keyboard shortcuts

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