capture

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package capture provides dummy implementations of some of the plugin services that capture data fed into them in order to allow validation in tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmojiReactionCaptor

type EmojiReactionCaptor struct {
	Channel   string
	Timestamp string
	Emojis    []string
}

EmojiReactionCaptor captures emoji reactions recorded by invocations of AddReaction. It only supports recording emojis for one given channel and timestamp

func NewEmojiReactor

func NewEmojiReactor() (emojiReactionCaptor *EmojiReactionCaptor)

NewEmojiReactor returns a new EmojiReactionCaptor with an initialized emojis array

func (*EmojiReactionCaptor) AddReaction

func (e *EmojiReactionCaptor) AddReaction(name string, item slack.ItemRef) error

AddReaction captures the addition of an emoji reaction with the given named emoji to the given item

type FileUploadCaptor

type FileUploadCaptor struct {
	FileUploads []slack.FileUploadParameters
	// contains filtered or unexported fields
}

FileUploadCaptor captures file uploads recorded by invocations of UploadFile

func NewFileUploader

func NewFileUploader() (fileUploadCaptor *FileUploadCaptor)

NewFileUploader returns a new FileUploadCaptor with an initialized array of FileUploads

func (*FileUploadCaptor) UploadFile

func (f *FileUploadCaptor) UploadFile(params slack.FileUploadParameters) (file *slack.File, err error)

UploadFile tracks a file upload for post-execution validation

type RealTimeSenderCaptor

type RealTimeSenderCaptor struct {
	SentMessages map[string][]string
}

RealTimeSenderCaptor holds messages sent to it keyed by channel ID

func NewRealTimeSender

func NewRealTimeSender() (rtms *RealTimeSenderCaptor)

NewRealTimeSender returns a new initialized RealTimeSenderCaptor instance

func (*RealTimeSenderCaptor) NewOutgoingMessage

func (rtms *RealTimeSenderCaptor) NewOutgoingMessage(text string, channelID string, options ...slack.RTMsgOption) *slack.OutgoingMessage

NewOutgoingMessage creates an approximation of a message to send (the message itself and the channel it's sent to) The returned OutgoingMessage has only the channel ID and text set on it

func (*RealTimeSenderCaptor) SendMessage

func (rtms *RealTimeSenderCaptor) SendMessage(outMsg *slack.OutgoingMessage)

SendMessage captures the sent message

Jump to

Keyboard shortcuts

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