rocketchat

package
v4.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *model.NotifRocketChat, meta model.Meta) notifier.Notifier

New creates a new rocketchat notification instance

Types

type Attachment

type Attachment struct {
	AudioURL    string            `json:"audio_url,omitempty"`
	AuthorIcon  string            `json:"author_icon,omitempty"`
	AuthorLink  string            `json:"author_link,omitempty"`
	AuthorName  string            `json:"author_name,omitempty"`
	Collapsed   bool              `json:"collapsed,omitempty"`
	Color       bool              `json:"color,omitempty"`
	Fields      []AttachmentField `json:"fields,omitempty"`
	ImageURL    string            `json:"image_url,omitempty"`
	MessageLink string            `json:"message_link,omitempty"`
	Text        string            `json:"text"`
	ThumbURL    string            `json:"thumb_url,omitempty"`
	Title       string            `json:"title,omitempty"`
	TitleLink   string            `json:"title_link,omitempty"`
	Ts          json.Number       `json:"ts,omitempty"`
	VideoURL    string            `json:"video_url,omitempty"`
}

Attachment contains all the information for an attachment

type AttachmentField

type AttachmentField struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

AttachmentField contains information for an attachment field An Attachment can contain multiple of these

type Client

type Client struct {
	*notifier.Notifier
	// contains filtered or unexported fields
}

Client represents an active rocketchat notification object

func (*Client) Name

func (c *Client) Name() string

Name returns notifier's name

func (*Client) Send

func (c *Client) Send(entry model.NotifEntry) error

Send creates and sends a rocketchat notification with an entry https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/

type Message

type Message struct {
	Alias       string       `json:"alias,omitempty"`
	Avatar      string       `json:"avatar,omitempty"`
	Channel     string       `json:"channel,omitempty"`
	Emoji       string       `json:"emoji,omitempty"`
	RoomID      string       `json:"roomId,omitempty"`
	Text        string       `json:"text,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

Message contains all the information for a message

Jump to

Keyboard shortcuts

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