slack

package module
v0.0.0-...-49c4f65 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

README

Google Cloud Platform logo

Google Cloud Functions - Slack Slash Command sample

See:

Documentation

Overview

Package slack is a Cloud Function which receives a query from a Slack command and responds with the KG API result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Color     string `json:"color"`
	Title     string `json:"title"`
	TitleLink string `json:"title_link"`
	Text      string `json:"text"`
	ImageURL  string `json:"image_url"`
}

type DetailedDesc

type DetailedDesc struct {
	ArticleBody string
	URL         string
}

type EntitySearchResult

type EntitySearchResult struct {
	Name         string       `json:"name"`
	Description  string       `json:"description"`
	DetailedDesc DetailedDesc `json:"detailedDescription"`
	URL          string       `json:"url"`
	Image        Image
}

type Image

type Image struct {
	ContentURL string
}

type ItemList

type ItemList struct {
	Items []ItemListElement `json:"itemListElement"`
}

type ItemListElement

type ItemListElement struct {
	Result EntitySearchResult `json:"result"`
}

type Message

type Message struct {
	ResponseType string       `json:"response_type"`
	Text         string       `json:"text"`
	Attachments  []Attachment `json:"attachments"`
}

Message is the a Slack message event. see https://api.slack.com/docs/message-formatting

Jump to

Keyboard shortcuts

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