slacksource

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdapter

NewAdapter satisfies pkgadapter.AdapterConstructor.

func NewEnvConfig

func NewEnvConfig() adapter.EnvConfigAccessor

NewEnvConfig satisfies pkgadapter.EnvConfigConstructor.

Types

type SlackChallenge

type SlackChallenge struct {
	Category  string `json:"type"`
	Token     string `json:"token"`
	Challenge string `json:"challenge"`
}

SlackChallenge contains the handshake challenge for the Slack events API.

type SlackChallengeResponse

type SlackChallengeResponse struct {
	Challenge string `json:"challenge"`
}

SlackChallengeResponse is the handshake response for a challenge.

type SlackEvent

type SlackEvent map[string]interface{}

SlackEvent contains the event payload

func (SlackEvent) Type

func (e SlackEvent) Type() string

Type for the event

type SlackEventAPIHandler

type SlackEventAPIHandler interface {
	Start(ctx context.Context) error
}

SlackEventAPIHandler listen for Slack API Events

func NewSlackEventAPIHandler

func NewSlackEventAPIHandler(ceClient cloudevents.Client, port int, signingSecret, appID string, tw timeWrap, logger *zap.SugaredLogger) SlackEventAPIHandler

NewSlackEventAPIHandler creates the default implementation of the Slack API Events handler

type SlackEventWrapper

type SlackEventWrapper struct {
	AdditionalProperties map[string]interface{} `json:"-,omitempty"`

	APIAppID    string     `json:"api_app_id"`
	AuthedUsers []string   `json:"authed_users"`
	Event       SlackEvent `json:"event"`
	EventID     string     `json:"event_id"`
	EventTime   int        `json:"event_time"`
	TeamID      string     `json:"team_id"`
	Token       string     `json:"token"`
	Type        string     `json:"type"`
}

SlackEventWrapper contains a common wrapper for all events. See https://api.slack.com/types/event for reference.

Jump to

Keyboard shortcuts

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