alert

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pending    QueueStatus = "pending"
	InProgress             = "in-progress"
	Delivered              = "delivered"
	Failed                 = "failed"
)
View Source
const (
	// Collection is the name of the collection in MongoDB that stores alerts.
	Collection = "alerts"
)

Variables

View Source
var (
	IdKey          = bsonutil.MustHaveTag(AlertRequest{}, "Id")
	HostIdKey      = bsonutil.MustHaveTag(AlertRequest{}, "HostId")
	TriggerKey     = bsonutil.MustHaveTag(AlertRequest{}, "Trigger")
	QueueStatusKey = bsonutil.MustHaveTag(AlertRequest{}, "QueueStatus")
	TaskIdKey      = bsonutil.MustHaveTag(AlertRequest{}, "TaskId")
	BuildIdKey     = bsonutil.MustHaveTag(AlertRequest{}, "BuildId")
	VersionIdKey   = bsonutil.MustHaveTag(AlertRequest{}, "VersionId")
	ProjectIdKey   = bsonutil.MustHaveTag(AlertRequest{}, "ProjectId")
	DisplayKey     = bsonutil.MustHaveTag(AlertRequest{}, "Display")
	CreatedAtKey   = bsonutil.MustHaveTag(AlertRequest{}, "CreatedAt")
)

Functions

func EnqueueAlertRequest

func EnqueueAlertRequest(a *AlertRequest) error

Types

type AlertRequest

type AlertRequest struct {
	Id          bson.ObjectId `bson:"_id"`
	QueueStatus QueueStatus   `bson:"queue_status"`
	Trigger     string        `bson:"trigger"`
	TaskId      string        `bson:"task_id,omitempty"`
	HostId      string        `bson:"host_id,omitempty"`
	Execution   int           `bson:"execution,omitempty"`
	BuildId     string        `bson:"build_id,omitempty"`
	VersionId   string        `bson:"version_id,omitempty"`
	ProjectId   string        `bson:"project_id,omitempty"`
	PatchId     string        `bson:"patch_id,omitempty"`
	Display     string        `bson:"display"`
	CreatedAt   time.Time     `bson:"created_at"`
	ProcessedAt time.Time     `bson:"processed_at"`
}

AlertRequest represents the raw database record of an alert that has been queued into the DB

func DequeueAlertRequest

func DequeueAlertRequest() (*AlertRequest, error)

type QueueStatus

type QueueStatus string

Jump to

Keyboard shortcuts

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