db

package
v0.0.0-...-28f90fc Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountAllMessagesByReference

func CountAllMessagesByReference(reference string) int

CountAllMessagesByReference : Count by Reference

func DialDB

func DialDB() (*mgo.Database, error)

DialDB : Connects to MongoDB

func RemoveAllMessagesByReference

func RemoveAllMessagesByReference(reference string)

RemoveAllMessagesByReference : Remove Messages by Reference

Types

type Event

type Event struct {
	EventID      string            `json:"eventId,omitempty"`
	Subject      string            `json:"subject"`
	Channel      map[string]bool   `json:"channel"`
	Recipient    []string          `json:"recipient"`
	UnmappedData map[string]string `json:"unmappedData"`
	EventType    string            `json:"eventType"`
	Description  string            `json:"description"`
	DateCreated  time.Time         `json:"dateCreated,omitempty"`
}

Event struct

type Message

type Message struct {
	ID              bson.ObjectId     `bson:"_id,omitempty"`
	MessageID       string            `bson:"messageId,omitempty"`
	Reference       string            `bson:"reference,omitempty"`
	AlertID         string            `bson:"alertId,omitempty"`
	UnmappedData    map[string]string `json:"unmappedData"`
	Subject         string            `bson:"subject,omitempty"`
	Content         string            `bson:"content,omitempty"`
	Recipient       string            `bson:"recipient,omitempty"`
	FileAttached    string            `bson:"fileAttached,omitempty"`
	MessageResponse MessageResponse   `bson:"messageResponse,omitempty"`
	DateCreated     time.Time         `bson:"dateCreated,omitempty"`
}

Message struct

func FindAllMessagesByReference

func FindAllMessagesByReference(reference string) ([]Message, error)

FindAllMessagesByReference : Find messages by Reference

func (Message) FindMessage

func (message Message) FindMessage(ID string) (Message, error)

FindMessage : Find Message by ID

func (*Message) IndexMessage

func (message *Message) IndexMessage() error

IndexMessage : Index Message

func (*Message) RemoveMessage

func (message *Message) RemoveMessage(ID string) bool

RemoveMessage : Remove Message by ID

func (*Message) UpdateResponse

func (message *Message) UpdateResponse(ID string, response MessageResponse) (Message, error)

UpdateResponse : Update Message with Response

type MessageResponse

type MessageResponse struct {
	Response       string    `bson:"response,omitempty"`
	Status         string    `bson:"status,omitempty"`
	APIStatus      string    `bson:"apiStatus,omitempty"`
	TimeOfResponse time.Time `bson:"timeOfResponse,omitempty"`
}

MessageResponse struct

Jump to

Keyboard shortcuts

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