fakeslack

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name string `json:"name,omitempty"`
	Text string `json:"text,omitempty"`
	Type string `json:"type,omitempty"`
	URL  string `json:"url,omitempty"`
}

type Attachment

type Attachment struct {
	Color      string   `json:"color,omitempty"`
	Fallback   string   `json:"fallback,omitempty"`
	CallbackID string   `json:"callback_id,omitempty"`
	Title      string   `json:"title,omitempty"`
	Actions    []Action `json:"actions,omitempty"`
	Timestamp  int      `json:"ts,omitempty"`
}

type FakeSlack

type FakeSlack struct {
	UsersByEmail map[string]*slack.User
	Messages     map[string][]Message
}

FakeSlack the fake slack

func NewFakeSlack

func NewFakeSlack() *FakeSlack

NewFakeSlack creates a new fake slack

func (*FakeSlack) AssertMessageCount

func (f *FakeSlack) AssertMessageCount(t *testing.T, channel string, expectedCount int, expectedMessageDir, expectedMessagePrefix string, generateTestOutput bool, message string) []Attachment

AssertMessageCount asserts the message count for the given channel

func (*FakeSlack) GetUserByEmail

func (f *FakeSlack) GetUserByEmail(email string) (*slack.User, error)

func (*FakeSlack) OpenConversation

func (f *FakeSlack) OpenConversation(_ *slack.OpenConversationParameters) (*slack.Channel, bool, bool, error)

func (*FakeSlack) SendMessage

func (f *FakeSlack) SendMessage(channel string, options ...slack.MsgOption) (string, string, string, error)

type Message

type Message struct {
	Channel   string
	Timestamp string
	Options   []slack.MsgOption
}

Jump to

Keyboard shortcuts

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