Documentation ¶
Index ¶
- type Attachment
- func (a Attachment) SetColor(c string) Attachment
- func (a Attachment) SetFields(f ...Field) Attachment
- func (a Attachment) SetMarkdown(m bool) Attachment
- func (a Attachment) SetMarkdownIn(opts ...MarkdownOption) Attachment
- func (a Attachment) SetText(t string) Attachment
- func (a Attachment) SetTitle(t string) Attachment
- func (a Attachment) SetTitleLink(l string) Attachment
- type AttachmentInterface
- type Field
- type Interface
- type MarkdownConfiguration
- type MarkdownOption
- type MockAttachmentInterface
- func (_m *MockAttachmentInterface) SetColor(c string) Attachment
- func (_m *MockAttachmentInterface) SetFields(f ...Field) Attachment
- func (_m *MockAttachmentInterface) SetMarkdown(m bool) Attachment
- func (_m *MockAttachmentInterface) SetMarkdownIn(opts ...MarkdownOption) Attachment
- func (_m *MockAttachmentInterface) SetText(t string) Attachment
- func (_m *MockAttachmentInterface) SetTitle(t string) Attachment
- func (_m *MockAttachmentInterface) SetTitleLink(l string) Attachment
- type MockInterface
- func (_m *MockInterface) Send() error
- func (_m *MockInterface) SendAsync(e chan error)
- func (_m *MockInterface) SetAttachments(a ...Attachment) *VSlack
- func (_m *MockInterface) SetChannel(c string) *VSlack
- func (_m *MockInterface) SetIconEmoji(i string) *VSlack
- func (_m *MockInterface) SetIncomingWebhookURI(h string) *VSlack
- func (_m *MockInterface) SetLinkNames(linkNames bool) *VSlack
- func (_m *MockInterface) SetMessage(m string) *VSlack
- func (_m *MockInterface) SetUsername(u string) *VSlack
- type MockMarkdownOption
- type VSlack
- func (v *VSlack) Send() error
- func (v *VSlack) SendAsync(e chan error)
- func (v *VSlack) SetAttachments(a ...Attachment) *VSlack
- func (v *VSlack) SetChannel(c string) *VSlack
- func (v *VSlack) SetIconEmoji(i string) *VSlack
- func (v *VSlack) SetIncomingWebhookURI(h string) *VSlack
- func (v *VSlack) SetLinkNames(linkNames bool) *VSlack
- func (v *VSlack) SetMessage(m string) *VSlack
- func (v *VSlack) SetUsername(u string) *VSlack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { Title string `json:"title"` TitleLink string `json:"title_link"` Text string `json:"text"` Fallback string `json:"fallback"` Markdown bool `json:"mrkdwn"` MarkdownIn []string `json:"mrkdwn_in,omitempty"` Color string `json:"color"` Fields []Field `json:"fields"` }
Attachment is a slack attachment
func NewVSlackAttachment ¶
func NewVSlackAttachment() Attachment
NewVSlackAttachment returns an instance of a new VSlack attachment
func (Attachment) SetColor ¶
func (a Attachment) SetColor(c string) Attachment
SetColor sets the message colour
func (Attachment) SetFields ¶
func (a Attachment) SetFields(f ...Field) Attachment
SetFields is the list of attachment fields
func (Attachment) SetMarkdown ¶
func (a Attachment) SetMarkdown(m bool) Attachment
SetMarkdown sets whether or not to use markdown in a message
func (Attachment) SetMarkdownIn ¶
func (a Attachment) SetMarkdownIn(opts ...MarkdownOption) Attachment
SetMarkdownIn takes in supported markdown types
func (Attachment) SetText ¶
func (a Attachment) SetText(t string) Attachment
SetText is an attachments text
func (Attachment) SetTitle ¶
func (a Attachment) SetTitle(t string) Attachment
SetTitle of the message
func (Attachment) SetTitleLink ¶
func (a Attachment) SetTitleLink(l string) Attachment
SetTitleLink of the message
type AttachmentInterface ¶
type AttachmentInterface interface { SetText(t string) Attachment SetColor(c string) Attachment SetTitle(t string) Attachment SetTitleLink(l string) Attachment SetFields(f ...Field) Attachment SetMarkdown(m bool) Attachment SetMarkdownIn(opts ...MarkdownOption) Attachment }
AttachmentInterface is the interface for an attachment
type Interface ¶
type Interface interface { SetIncomingWebhookURI(h string) *VSlack SetChannel(c string) *VSlack SetUsername(u string) *VSlack SetIconEmoji(i string) *VSlack SetMessage(m string) *VSlack Send() error SendAsync(e chan error) SetAttachments(a ...Attachment) *VSlack SetLinkNames(linkNames bool) *VSlack // contains filtered or unexported methods }
Interface is a VSlack interface
type MarkdownConfiguration ¶
type MarkdownConfiguration struct {
// contains filtered or unexported fields
}
MarkdownConfiguration are options for message markdown
type MarkdownOption ¶
type MarkdownOption func(m *MarkdownConfiguration)
MarkdownOption is an option for markdown in a slack message
type MockAttachmentInterface ¶
MockAttachmentInterface is an autogenerated mock type for the AttachmentInterface type
func (*MockAttachmentInterface) SetColor ¶
func (_m *MockAttachmentInterface) SetColor(c string) Attachment
SetColor provides a mock function with given fields: c
func (*MockAttachmentInterface) SetFields ¶
func (_m *MockAttachmentInterface) SetFields(f ...Field) Attachment
SetFields provides a mock function with given fields: f
func (*MockAttachmentInterface) SetMarkdown ¶
func (_m *MockAttachmentInterface) SetMarkdown(m bool) Attachment
SetMarkdown provides a mock function with given fields: m
func (*MockAttachmentInterface) SetMarkdownIn ¶
func (_m *MockAttachmentInterface) SetMarkdownIn(opts ...MarkdownOption) Attachment
SetMarkdownIn provides a mock function with given fields: opts
func (*MockAttachmentInterface) SetText ¶
func (_m *MockAttachmentInterface) SetText(t string) Attachment
SetText provides a mock function with given fields: t
func (*MockAttachmentInterface) SetTitle ¶
func (_m *MockAttachmentInterface) SetTitle(t string) Attachment
SetTitle provides a mock function with given fields: t
func (*MockAttachmentInterface) SetTitleLink ¶
func (_m *MockAttachmentInterface) SetTitleLink(l string) Attachment
SetTitleLink provides a mock function with given fields: l
type MockInterface ¶
MockInterface is an autogenerated mock type for the Interface type
func (*MockInterface) Send ¶
func (_m *MockInterface) Send() error
Send provides a mock function with given fields:
func (*MockInterface) SendAsync ¶
func (_m *MockInterface) SendAsync(e chan error)
SendAsync provides a mock function with given fields: e
func (*MockInterface) SetAttachments ¶
func (_m *MockInterface) SetAttachments(a ...Attachment) *VSlack
SetAttachments provides a mock function with given fields: a
func (*MockInterface) SetChannel ¶
func (_m *MockInterface) SetChannel(c string) *VSlack
SetChannel provides a mock function with given fields: c
func (*MockInterface) SetIconEmoji ¶
func (_m *MockInterface) SetIconEmoji(i string) *VSlack
SetIconEmoji provides a mock function with given fields: i
func (*MockInterface) SetIncomingWebhookURI ¶
func (_m *MockInterface) SetIncomingWebhookURI(h string) *VSlack
SetIncomingWebhookURI provides a mock function with given fields: h
func (*MockInterface) SetLinkNames ¶
func (_m *MockInterface) SetLinkNames(linkNames bool) *VSlack
SetLinkNames provides a mock function with given fields: linkNames
func (*MockInterface) SetMessage ¶
func (_m *MockInterface) SetMessage(m string) *VSlack
SetMessage provides a mock function with given fields: m
func (*MockInterface) SetUsername ¶
func (_m *MockInterface) SetUsername(u string) *VSlack
SetUsername provides a mock function with given fields: u
type MockMarkdownOption ¶
MockMarkdownOption is an autogenerated mock type for the MarkdownOption type
func (*MockMarkdownOption) Execute ¶
func (_m *MockMarkdownOption) Execute(m *MarkdownConfiguration)
Execute provides a mock function with given fields: m
type VSlack ¶
type VSlack struct { IncomingWebhookURI string `json:"-"` Message string `json:"text,omitempty"` Username string `json:"username"` IconEmoji string `json:"icon_emoji,omitempty"` Channel string `json:"channel"` Attachments []Attachment `json:"attachments,omitempty"` LinkNames bool `json:"link_names,omitempty"` }
VSlack a structure holding data for the slack message
func (*VSlack) SetAttachments ¶
func (v *VSlack) SetAttachments(a ...Attachment) *VSlack
SetAttachments takes in attachments
func (*VSlack) SetChannel ¶
SetChannel sets the channel
func (*VSlack) SetIconEmoji ¶
SetIconEmoji sets the emoji for the icon
func (*VSlack) SetIncomingWebhookURI ¶
SetIncomingwebHookURI sets the incoming web hook
func (*VSlack) SetLinkNames ¶
SetLinkNames takes in attachments
func (*VSlack) SetMessage ¶
SetMessage sets the message
func (*VSlack) SetUsername ¶
SetUsername sets the username