notification

package
v0.0.0-...-ee3d319 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotificationsCollection = "notifications"
)

Variables

This section is empty.

Functions

func ByID

func ByID(id bson.ObjectId) db.Q

func InsertMany

func InsertMany(items ...Notification) error

Types

type EmailPayload

type EmailPayload struct {
	Headers map[string]string `bson:"headers"`
	Subject string            `bson:"subject"`
	Body    []byte            `bson:"body"`
}

type GithubStatusAPIPayload

type GithubStatusAPIPayload struct {
	Status      string `bson:"status"`
	Context     string `bson:"context"`
	Description string `bson:"description"`
	URL         string `bson:"url"`
}

type Notification

type Notification struct {
	ID         bson.ObjectId    `bson:"_id"`
	Subscriber event.Subscriber `bson:"subscriber"`
	Payload    interface{}      `bson:"payload"`

	SentAt time.Time `bson:"sent_at,omitempty"`
	Error  string    `bson:"error,omitempty"`
}

func Find

func Find(id bson.ObjectId) (*Notification, error)

func (*Notification) Composer

func (n *Notification) Composer() (message.Composer, error)

func (*Notification) MarkError

func (n *Notification) MarkError(sendErr error) error

func (*Notification) MarkSent

func (n *Notification) MarkSent() error

func (*Notification) SetBSON

func (n *Notification) SetBSON(raw bson.Raw) error

Jump to

Keyboard shortcuts

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