messages

package
v0.0.0-...-e59334c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	From    string   `json:"from"`
	To      []string `json:"to"`
	Subject string   `json:"subject"`
	Body    string   `json:"body"`
	// contains filtered or unexported fields
}

Email is the representation of an e-mail message

func (*Email) Format

func (e *Email) Format() error

Format sets the format of a Sendable message

func (*Email) Init

func (bm *Email) Init(context interface{}, dedupKey string, payload *gabs.Container)

Init initializes the base properties of a message

func (*Email) Type

func (e *Email) Type() string

Type returns the message type

type PagerDuty

type PagerDuty struct {
	Event *pagerDutyEvent
	// contains filtered or unexported fields
}

Pager Duty is the representation of a Pager Duty message

func (*PagerDuty) Format

func (pd *PagerDuty) Format() error

Format formats a message to be sent over the specified channel

func (*PagerDuty) Init

func (bm *PagerDuty) Init(context interface{}, dedupKey string, payload *gabs.Container)

Init initializes the base properties of a message

func (*PagerDuty) Type

func (pd *PagerDuty) Type() string

Type returns the message type

type Sendable

type Sendable interface {
	// Format sets the format of a Sendable message
	Format() error

	// Type returns the message type
	Type() string

	// Init initializes the base properties of a message
	Init(context interface{}, dedupKey string, payload *gabs.Container)
}

Sendable represents the contract of a message that can be sent over a Notifiable channel

func NewMessage

func NewMessage(payload *gabs.Container, context interface{}, dedupKey string) (Sendable, error)

NewMessage returns a sendable message

type Slack

type Slack struct {
	Attachment *slackAttachment
	// contains filtered or unexported fields
}

Slack is the representation of a Slack message

func (*Slack) Format

func (s *Slack) Format() error

Format formats a message to be sent over the specified channel

func (*Slack) Init

func (bm *Slack) Init(context interface{}, dedupKey string, payload *gabs.Container)

Init initializes the base properties of a message

func (*Slack) Type

func (s *Slack) Type() string

Type returns the message type

Jump to

Keyboard shortcuts

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