Documentation ¶
Index ¶
- Constants
- Variables
- func AdminEventsBefore(before time.Time, n int) db.Q
- func AllRecentHostEventsMatchStatus(hostId string, n int, status string) bool
- func ByGuid(guid string) db.Q
- func CountUnprocessedEvents() (int, error)
- func DistroEventsForId(id string) db.Q
- func DistroEventsInOrder(id string) db.Q
- func HostEventsForId(id string) db.Q
- func HostEventsInOrder(id string) db.Q
- func IsSubscriptionAllowed(sub Subscription) (bool, string)
- func IsValidOwnerType(in string) bool
- func LogAdminEvent(section string, before, after evergreen.ConfigSection, user string) error
- func LogBuildStateChangeEvent(id, status string)
- func LogCommitQueueConcludeTest(patchID, status string)
- func LogCommitQueueStartTestEvent(patchID string)
- func LogDisplayTaskFinished(taskId string, execution int, status string)
- func LogDistroAdded(distroId, userId string, data interface{})
- func LogDistroEvent(distroId string, eventType string, eventData DistroEventData)
- func LogDistroModified(distroId, userId string, data interface{})
- func LogDistroRemoved(distroId, userId string, data interface{})
- func LogExpirationWarningSent(hostID string)
- func LogHostAgentDeployFailed(hostId string, err error)
- func LogHostAgentDeployed(hostId string)
- func LogHostAgentMonitorDeployFailed(hostId string, err error)
- func LogHostAgentMonitorDeployed(hostId string)
- func LogHostCreated(hostId string)
- func LogHostDNSNameSet(hostId string, dnsName string)
- func LogHostEvent(hostId string, eventType string, eventData HostEventData)
- func LogHostJasperDeployFailed(hostId string, err error)
- func LogHostJasperDeployed(hostId string, revision string)
- func LogHostProvisionError(hostId string)
- func LogHostProvisioned(hostId string)
- func LogHostRunningTaskCleared(hostId string, taskId string)
- func LogHostRunningTaskSet(hostId string, taskId string)
- func LogHostScriptExecuteFailed(hostID string, err error)
- func LogHostScriptExecuted(hostID string, logs string)
- func LogHostStarted(hostId string)
- func LogHostStatusChanged(hostId, oldStatus, newStatus, user string, logs string)
- func LogHostTaskPidSet(hostId string, taskPid string)
- func LogHostTeardown(hostId, teardownLogs string, success bool, duration time.Duration)
- func LogHostTerminatedExternally(hostId string)
- func LogJiraIssueCreated(taskId string, execution int, jiraIssue string)
- func LogManyTaskAbortRequests(taskIds []string, userId string)
- func LogMonitorOperation(hostId string, op string)
- func LogPatchStateChangeEvent(id, newStatus string)
- func LogProvisionFailed(hostId string, setupLogs string)
- func LogSchedulerEvent(eventData SchedulerEventData)
- func LogTaskAbortRequest(taskId string, execution int, userId string)
- func LogTaskActivated(taskId string, execution int, userId string)
- func LogTaskCreated(taskId string, execution int)
- func LogTaskDeactivated(taskId string, execution int, userId string)
- func LogTaskDependenciesOverridden(taskId string, execution int, userID string)
- func LogTaskDispatched(taskId string, execution int, hostId string)
- func LogTaskFinished(taskId string, execution int, hostId, status string)
- func LogTaskPriority(taskId string, execution int, user string, priority int64)
- func LogTaskRestarted(taskId string, execution int, userId string)
- func LogTaskScheduled(taskId string, execution int, scheduledTime time.Time)
- func LogTaskStarted(taskId string, execution int)
- func LogTaskUndispatched(taskId string, execution int, hostId string)
- func LogVersionStateChangeEvent(id, newStatus string)
- func MostRecentDistroEvents(id string, n int) db.Q
- func MostRecentHostEvents(id string, n int) db.Q
- func MostRecentTaskEvents(id string, n int) db.Q
- func NewEventFromType(resourceType string) interface{}
- func RecentAdminEvents(n int) db.Q
- func RecentSchedulerEvents(distroId string, n int) db.Q
- func RemoveSubscription(id string) error
- func ResourceTypeKeyIs(key string) bson.M
- func RevertConfig(guid string, user string) error
- func SchedulerEventsForId(distroID string) db.Q
- func TaskEventsForId(id string) db.Q
- func TaskEventsInOrder(id string) db.Q
- func UpdateExecutions(hostId, taskId string, execution int) error
- func ValidateSelectors(subscriber Subscriber, selectors []Selector) (bool, string)
- type AdminEventData
- type BuildEventData
- type CommitQueueEventData
- type ConfigDataChange
- type DBEventLogger
- type DistroEventData
- type EventLogEntry
- type EventLogger
- type GithubMergeSubscriber
- type GithubPullRequestSubscriber
- type HostEventData
- type JIRAIssueSubscriber
- type OwnerType
- type PRInfo
- type PatchEventData
- type RecentHostAgentDeploys
- type SchedulerEventData
- type Selector
- type Subscriber
- type Subscription
- func CreateOrUpdateImplicitSubscription(resourceType string, id string, subscriber Subscriber, user string) (*Subscription, error)
- func FindSubscriptionByID(id string) (*Subscription, error)
- func FindSubscriptions(resourceType string, selectors []Selector) ([]Subscription, error)
- func FindSubscriptionsByOwner(owner string, ownerType OwnerType) ([]Subscription, error)
- func NewBuildBreakSubscriptionByOwner(owner string, sub Subscriber) Subscription
- func NewBuildOutcomeSubscriptionByVersion(versionID string, sub Subscriber) Subscription
- func NewCommitQueueSubscriptionByOwner(owner string, sub Subscriber) Subscription
- func NewPatchOutcomeSubscription(id string, sub Subscriber) Subscription
- func NewPatchOutcomeSubscriptionByOwner(owner string, sub Subscriber) Subscription
- func NewSpawnHostOutcomeByOwner(owner string, sub Subscriber) Subscription
- func NewSpawnhostExpirationSubscription(owner string, sub Subscriber) Subscription
- func NewSubscriptionByID(resourceType, trigger, id string, sub Subscriber) Subscription
- func NewSubscriptionByOwner(owner string, sub Subscriber, resourceType, trigger string) Subscription
- type TaskEventData
- type TaskQueueInfo
- type UnmarshalEventLogEntry
- type VersionEventData
- type WebhookSubscriber
Constants ¶
const ( ResourceTypeAdmin = "ADMIN" EventTypeValueChanged = "CONFIG_VALUE_CHANGED" )
const ( ResourceTypeBuild = "BUILD" BuildStateChange = "STATE_CHANGE" )
const ( ResourceTypeCommitQueue = "COMMIT_QUEUE" CommitQueueStartTest = "START_TEST" CommitQueueConcludeTest = "CONCLUDE_TEST" )
const ( // resource type ResourceTypeDistro = "DISTRO" // event types EventDistroAdded = "DISTRO_ADDED" EventDistroModified = "DISTRO_MODIFIED" EventDistroRemoved = "DISTRO_REMOVED" )
const ( AllLogCollection = "event_log" TaskLogCollection = "task_event_log" )
const ( // resource type ResourceTypeHost = "HOST" // event types EventHostCreated = "HOST_CREATED" EventHostStarted = "HOST_STARTED" EventHostAgentDeployed = "HOST_AGENT_DEPLOYED" EventHostAgentDeployFailed = "HOST_AGENT_DEPLOY_FAILED" EventHostAgentMonitorDeployed = "HOST_AGENT_MONITOR_DEPLOYED" EventHostAgentMonitorDeployFailed = "HOST_AGENT_MONITOR_DEPLOY_FAILED" EventHostJasperDeployed = "HOST_JASPER_DEPLOYED" EventHostJasperDeployFailed = "HOST_JASPER_DEPLOY_FAILED" EventHostStatusChanged = "HOST_STATUS_CHANGED" EventHostDNSNameSet = "HOST_DNS_NAME_SET" EventHostProvisionError = "HOST_PROVISION_ERROR" EventHostProvisionFailed = "HOST_PROVISION_FAILED" EventHostProvisioned = "HOST_PROVISIONED" EventHostRunningTaskSet = "HOST_RUNNING_TASK_SET" EventHostRunningTaskCleared = "HOST_RUNNING_TASK_CLEARED" EventHostTaskPidSet = "HOST_TASK_PID_SET" EventHostMonitorFlag = "HOST_MONITOR_FLAG" EventTaskFinished = "HOST_TASK_FINISHED" EventHostTeardown = "HOST_TEARDOWN" EventHostTerminatedExternally = "HOST_TERMINATED_EXTERNALLY" EventHostExpirationWarningSent = "HOST_EXPIRATION_WARNING_SENT" EventHostScriptExecuted = "HOST_SCRIPT_EXECUTED" EventHostScriptExecuteFailed = "HOST_SCRIPT_EXECUTE_FAILED" )
const ( ResourceTypePatch = "PATCH" PatchStateChange = "STATE_CHANGE" )
const ( // resource type ResourceTypeScheduler = "SCHEDULER" // event types EventSchedulerRun = "SCHEDULER_RUN" )
const ( GithubPullRequestSubscriberType = "github_pull_request" JIRAIssueSubscriberType = "jira-issue" JIRACommentSubscriberType = "jira-comment" EvergreenWebhookSubscriberType = "evergreen-webhook" EmailSubscriberType = "email" SlackSubscriberType = "slack" GithubMergeSubscriberType = "github-merge" CommitQueueDequeueSubscriberType = "commit-queue-dequeue" SubscriberTypeNone = "none" )
const ( OwnerTypePerson OwnerType = "person" OwnerTypeProject OwnerType = "project" TaskDurationKey = "task-duration-secs" TaskPercentChangeKey = "task-percent-change" BuildDurationKey = "build-duration-secs" BuildPercentChangeKey = "build-percent-change" VersionDurationKey = "version-duration-secs" VersionPercentChangeKey = "version-percent-change" TestRegexKey = "test-regex" RenotifyIntervalKey = "renotify-interval" ImplicitSubscriptionPatchOutcome = "patch-outcome" ImplicitSubscriptionBuildBreak = "build-break" ImplicitSubscriptionSpawnhostExpiration = "spawnhost-expiration" ImplicitSubscriptionSpawnHostOutcome = "spawnhost-outcome" ImplicitSubscriptionCommitQueue = "commit-queue" ObjectTask = "task" ObjectVersion = "version" ObjectBuild = "build" ObjectHost = "host" ObjectPatch = "patch" TriggerOutcome = "outcome" TriggerFailure = "failure" TriggerSuccess = "success" TriggerRegression = "regression" TriggerExceedsDuration = "exceeds-duration" TriggerRuntimeChangeByPercent = "runtime-change" TriggerExpiration = "expiration" TriggerPatchStarted = "started" )
const ( SelectorObject = "object" SelectorID = "id" SelectorProject = "project" SelectorOwner = "owner" SelectorRequester = "requester" SelectorStatus = "status" SelectorDisplayName = "display-name" SelectorBuildVariant = "build-variant" SelectorInVersion = "in-version" SelectorInBuild = "in-build" )
const ( // resource type ResourceTypeTask = "TASK" // event types TaskCreated = "TASK_CREATED" TaskDispatched = "TASK_DISPATCHED" TaskUndispatched = "TASK_UNDISPATCHED" TaskStarted = "TASK_STARTED" TaskFinished = "TASK_FINISHED" TaskRestarted = "TASK_RESTARTED" TaskActivated = "TASK_ACTIVATED" TaskDeactivated = "TASK_DEACTIVATED" TaskAbortRequest = "TASK_ABORT_REQUEST" TaskScheduled = "TASK_SCHEDULED" TaskPriorityChanged = "TASK_PRIORITY_CHANGED" TaskJiraAlertCreated = "TASK_JIRA_ALERT_CREATED" TaskDepdendenciesOverridden = "TASK_DEPENDENCIES_OVERRIDDEN" )
const ( ResourceTypeVersion = "VERSION" VersionStateChange = "STATE_CHANGE" )
const (
SubscriptionsCollection = "subscriptions"
)
Variables ¶
var ( TimestampKey = bsonutil.MustHaveTag(EventLogEntry{}, "Timestamp") ResourceIdKey = bsonutil.MustHaveTag(EventLogEntry{}, "ResourceId") ResourceTypeKey = bsonutil.MustHaveTag(EventLogEntry{}, "ResourceType") TypeKey = bsonutil.MustHaveTag(EventLogEntry{}, "EventType") DataKey = bsonutil.MustHaveTag(EventLogEntry{}, "Data") )
Functions ¶
func CountUnprocessedEvents ¶
func DistroEventsInOrder ¶
func HostEventsInOrder ¶
func IsSubscriptionAllowed ¶
func IsSubscriptionAllowed(sub Subscription) (bool, string)
func IsValidOwnerType ¶
func LogAdminEvent ¶
func LogAdminEvent(section string, before, after evergreen.ConfigSection, user string) error
func LogBuildStateChangeEvent ¶
func LogBuildStateChangeEvent(id, status string)
func LogCommitQueueConcludeTest ¶
func LogCommitQueueConcludeTest(patchID, status string)
func LogCommitQueueStartTestEvent ¶
func LogCommitQueueStartTestEvent(patchID string)
func LogDisplayTaskFinished ¶
func LogDistroAdded ¶
func LogDistroAdded(distroId, userId string, data interface{})
func LogDistroEvent ¶
func LogDistroEvent(distroId string, eventType string, eventData DistroEventData)
func LogDistroModified ¶
func LogDistroModified(distroId, userId string, data interface{})
func LogDistroRemoved ¶
func LogDistroRemoved(distroId, userId string, data interface{})
func LogExpirationWarningSent ¶
func LogExpirationWarningSent(hostID string)
func LogHostAgentDeployed ¶
func LogHostAgentDeployed(hostId string)
func LogHostAgentMonitorDeployed ¶
func LogHostAgentMonitorDeployed(hostId string)
func LogHostCreated ¶
func LogHostCreated(hostId string)
func LogHostDNSNameSet ¶
func LogHostEvent ¶
func LogHostEvent(hostId string, eventType string, eventData HostEventData)
func LogHostJasperDeployed ¶
func LogHostProvisionError ¶
func LogHostProvisionError(hostId string)
LogHostProvisionError is used to log each failed provision attempt
func LogHostProvisioned ¶
func LogHostProvisioned(hostId string)
func LogHostRunningTaskSet ¶
func LogHostScriptExecuted ¶
func LogHostStarted ¶
func LogHostStarted(hostId string)
func LogHostStatusChanged ¶
func LogHostTaskPidSet ¶
func LogHostTeardown ¶
func LogHostTerminatedExternally ¶
func LogHostTerminatedExternally(hostId string)
func LogJiraIssueCreated ¶
func LogMonitorOperation ¶
func LogPatchStateChangeEvent ¶
func LogPatchStateChangeEvent(id, newStatus string)
func LogProvisionFailed ¶
LogProvisionFailed is used when Evergreen gives up on spawning a host after several retries
func LogSchedulerEvent ¶
func LogSchedulerEvent(eventData SchedulerEventData)
LogSchedulerEvent takes care of logging the statistics about the scheduler at a given time. The ResourceId is the time that the scheduler runs.
func LogTaskAbortRequest ¶
func LogTaskActivated ¶
func LogTaskCreated ¶
func LogTaskDeactivated ¶
func LogTaskDispatched ¶
func LogTaskFinished ¶
func LogTaskPriority ¶
func LogTaskRestarted ¶
func LogTaskScheduled ¶
func LogTaskStarted ¶
func LogTaskUndispatched ¶
func LogVersionStateChangeEvent ¶
func LogVersionStateChangeEvent(id, newStatus string)
func NewEventFromType ¶
func NewEventFromType(resourceType string) interface{}
func RecentAdminEvents ¶
Admin Events RecentAdminEvents returns the N most recent admin events
func RemoveSubscription ¶
func ResourceTypeKeyIs ¶
func RevertConfig ¶
RevertConfig reverts one config section to the before state of the specified GUID in the event log
func TaskEventsInOrder ¶
func UpdateExecutions ¶
UpdateExecutions updates host events to track multiple executions of the same task
func ValidateSelectors ¶
func ValidateSelectors(subscriber Subscriber, selectors []Selector) (bool, string)
Types ¶
type AdminEventData ¶
type AdminEventData struct { GUID string `bson:"guid" json:"guid"` User string `bson:"user" json:"user"` Section string `bson:"section" json:"section"` Changes ConfigDataChange `bson:"changes" json:"changes"` }
AdminEventData holds all potential data properties of a logged admin event
type BuildEventData ¶
type BuildEventData struct {
Status string `bson:"status" json:"status"`
}
type CommitQueueEventData ¶
type CommitQueueEventData struct {
Status string `bson:"status,omitempty" json:"status,omitempty"`
}
type ConfigDataChange ¶
type ConfigDataChange struct { Before evergreen.ConfigSection `bson:"before" json:"before"` After evergreen.ConfigSection `bson:"after" json:"after"` }
type DBEventLogger ¶
type DBEventLogger struct {
// contains filtered or unexported fields
}
func NewDBEventLogger ¶
func NewDBEventLogger(collection string) *DBEventLogger
func (*DBEventLogger) LogEvent ¶
func (l *DBEventLogger) LogEvent(e *EventLogEntry) error
func (*DBEventLogger) LogManyEvents ¶
func (l *DBEventLogger) LogManyEvents(events []EventLogEntry) error
func (*DBEventLogger) MarkProcessed ¶
func (l *DBEventLogger) MarkProcessed(event *EventLogEntry) error
type DistroEventData ¶
type DistroEventData struct { DistroId string `bson:"d_id,omitempty" json:"d_id,omitempty"` UserId string `bson:"u_id,omitempty" json:"u_id,omitempty"` Data interface{} `bson:"dstr,omitempty" json:"dstr,omitempty"` }
DistroEventData implements EventData.
type EventLogEntry ¶
type EventLogEntry struct { ID string `bson:"_id" json:"-"` ResourceType string `bson:"r_type,omitempty" json:"resource_type,omitempty"` ProcessedAt time.Time `bson:"processed_at" json:"processed_at"` Timestamp time.Time `bson:"ts" json:"timestamp"` ResourceId string `bson:"r_id" json:"resource_id"` EventType string `bson:"e_type" json:"event_type"` Data interface{} `bson:"data" json:"data"` }
func Find ¶
func Find(coll string, query db.Q) ([]EventLogEntry, error)
Find takes a collection storing events and a query, generated by one of the query functions, and returns a slice of events.
func FindAllByResourceID ¶
func FindAllByResourceID(resourceID string) ([]EventLogEntry, error)
func FindLastProcessedEvent ¶
func FindLastProcessedEvent() (*EventLogEntry, error)
func FindUnprocessedEvents ¶
func FindUnprocessedEvents() ([]EventLogEntry, error)
FindUnprocessedEvents returns all unprocessed events in AllLogCollection. Events are considered unprocessed if their "processed_at" time IsZero
func (*EventLogEntry) MarshalBSON ¶
func (e *EventLogEntry) MarshalBSON() ([]byte, error)
func (*EventLogEntry) Processed ¶
func (e *EventLogEntry) Processed() (bool, time.Time)
Processed is whether or not this event has been processed. An event which has been processed has successfully have notifications intents created and stored, but does not indicate whether or not these notifications have been successfully sent to all recipients If true, the time is the time that this event was marked as processed. If false, time is the zero time
func (*EventLogEntry) UnmarshalBSON ¶
func (e *EventLogEntry) UnmarshalBSON(in []byte) error
type EventLogger ¶
type EventLogger interface {
LogEvent(event *EventLogEntry) error
}
type GithubMergeSubscriber ¶
type GithubMergeSubscriber struct { PRs []PRInfo `bson:"prs"` Item string `bson:"item"` MergeMethod string `bson:"merge_method"` }
func (*GithubMergeSubscriber) String ¶
func (s *GithubMergeSubscriber) String() string
type GithubPullRequestSubscriber ¶
type GithubPullRequestSubscriber struct { Owner string `bson:"owner"` Repo string `bson:"repo"` PRNumber int `bson:"pr_number"` Ref string `bson:"ref"` }
func (*GithubPullRequestSubscriber) String ¶
func (s *GithubPullRequestSubscriber) String() string
type HostEventData ¶
type HostEventData struct { AgentRevision string `bson:"a_rev,omitempty" json:"agent_revision,omitempty"` JasperRevision string `bson:"j_rev,omitempty" json:"jasper_revision,omitempty"` OldStatus string `bson:"o_s,omitempty" json:"old_status,omitempty"` NewStatus string `bson:"n_s,omitempty" json:"new_status,omitempty"` Logs string `bson:"log,omitempty" json:"logs,omitempty"` Hostname string `bson:"hn,omitempty" json:"hostname,omitempty"` TaskId string `bson:"t_id,omitempty" json:"task_id,omitempty"` TaskExecution int `bson:"t_execution,omitempty" json:"task_execution,omitempty"` TaskPid string `bson:"t_pid,omitempty" json:"task_pid,omitempty"` TaskStatus string `bson:"t_st,omitempty" json:"task_status,omitempty"` Execution string `bson:"execution,omitempty" json:"execution,omitempty"` MonitorOp string `bson:"monitor_op,omitempty" json:"monitor,omitempty"` User string `bson:"usr" json:"user,omitempty"` Successful bool `bson:"successful,omitempty" json:"successful"` Duration time.Duration `bson:"duration,omitempty" json:"duration"` }
implements EventData
type JIRAIssueSubscriber ¶
type JIRAIssueSubscriber struct { Project string `bson:"project"` IssueType string `bson:"issue_type"` }
func (*JIRAIssueSubscriber) String ¶
func (s *JIRAIssueSubscriber) String() string
type PatchEventData ¶
type PatchEventData struct {
Status string `bson:"status,omitempty" json:"status,omitempty"`
}
type RecentHostAgentDeploys ¶
type RecentHostAgentDeploys struct { HostID string `bson:"host_id" json:"host_id" yaml:"host_id"` Count int `bson:"count" json:"count" yaml:"count"` Failed int `bson:"failed" json:"failed" yaml:"failed"` Success int `bson:"success" json:"success" yaml:"success"` HostStatusChanged int `bson:"host_status_changed" json:"host_status_changed" yaml:"host_status_changed"` Last string `bson:"last" json:"last" yaml:"last"` Total int `bson:"total" json:"total" yaml:"total"` message.Base `bson:"metadata" json:"metadata" yaml:"metadata"` }
RecentHostAgentDeploys is a type used to capture the results of an agent deploy.
func GetRecentAgentDeployStatuses ¶
func GetRecentAgentDeployStatuses(hostID string, n int) (*RecentHostAgentDeploys, error)
GetRecentAgentDeployStatuses gets status of the the n most recent agent deploy attempts for the given hostID.
func GetRecentAgentMonitorDeployStatuses ¶
func GetRecentAgentMonitorDeployStatuses(hostID string, n int) (*RecentHostAgentDeploys, error)
GetRecentAgentMonitorDeployStatuses gets status of the the n most recent agent monitor deploy attempts for the given hostID.
func (*RecentHostAgentDeploys) AllAttemptsFailed ¶
func (m *RecentHostAgentDeploys) AllAttemptsFailed() bool
func (*RecentHostAgentDeploys) LastAttemptFailed ¶
func (m *RecentHostAgentDeploys) LastAttemptFailed() bool
//////////////////////////////////////////////////////////////////////
Predicates to support error checking during the agent deploy process
func (*RecentHostAgentDeploys) Loggable ¶
func (m *RecentHostAgentDeploys) Loggable() bool
func (*RecentHostAgentDeploys) Raw ¶
func (m *RecentHostAgentDeploys) Raw() interface{}
func (*RecentHostAgentDeploys) String ¶
func (m *RecentHostAgentDeploys) String() string
type SchedulerEventData ¶
type SchedulerEventData struct { TaskQueueInfo TaskQueueInfo `bson:"tq_info" json:"task_queue_info"` DistroId string `bson:"d_id" json:"distro_id"` }
implements EventData
type Subscriber ¶
type Subscriber struct { Type string `bson:"type"` // sad violin Target interface{} `bson:"target"` }
func NewCommitQueueDequeueSubscriber ¶
func NewCommitQueueDequeueSubscriber() Subscriber
func NewEmailSubscriber ¶
func NewEmailSubscriber(t string) Subscriber
func NewGithubMergeSubscriber ¶
func NewGithubMergeSubscriber(s GithubMergeSubscriber) Subscriber
func NewGithubStatusAPISubscriber ¶
func NewGithubStatusAPISubscriber(s GithubPullRequestSubscriber) Subscriber
func NewSlackSubscriber ¶
func NewSlackSubscriber(t string) Subscriber
func (*Subscriber) MarshalBSON ¶
func (s *Subscriber) MarshalBSON() ([]byte, error)
func (*Subscriber) String ¶
func (s *Subscriber) String() string
func (*Subscriber) UnmarshalBSON ¶
func (s *Subscriber) UnmarshalBSON(in []byte) error
func (*Subscriber) Validate ¶
func (s *Subscriber) Validate() error
type Subscription ¶
type Subscription struct { ID string `bson:"_id"` ResourceType string `bson:"type"` Trigger string `bson:"trigger"` Selectors []Selector `bson:"selectors,omitempty"` RegexSelectors []Selector `bson:"regex_selectors,omitempty"` Subscriber Subscriber `bson:"subscriber"` OwnerType OwnerType `bson:"owner_type"` Owner string `bson:"owner"` TriggerData map[string]string `bson:"trigger_data,omitempty"` }
func CreateOrUpdateImplicitSubscription ¶
func CreateOrUpdateImplicitSubscription(resourceType string, id string, subscriber Subscriber, user string) (*Subscription, error)
func FindSubscriptionByID ¶
func FindSubscriptionByID(id string) (*Subscription, error)
func FindSubscriptions ¶
func FindSubscriptions(resourceType string, selectors []Selector) ([]Subscription, error)
FindSubscriptions finds all subscriptions of matching resourceType, and whose selectors match the selectors slice
func FindSubscriptionsByOwner ¶
func FindSubscriptionsByOwner(owner string, ownerType OwnerType) ([]Subscription, error)
func NewBuildBreakSubscriptionByOwner ¶
func NewBuildBreakSubscriptionByOwner(owner string, sub Subscriber) Subscription
func NewBuildOutcomeSubscriptionByVersion ¶
func NewBuildOutcomeSubscriptionByVersion(versionID string, sub Subscriber) Subscription
func NewCommitQueueSubscriptionByOwner ¶
func NewCommitQueueSubscriptionByOwner(owner string, sub Subscriber) Subscription
func NewPatchOutcomeSubscription ¶
func NewPatchOutcomeSubscription(id string, sub Subscriber) Subscription
func NewPatchOutcomeSubscriptionByOwner ¶
func NewPatchOutcomeSubscriptionByOwner(owner string, sub Subscriber) Subscription
func NewSpawnHostOutcomeByOwner ¶
func NewSpawnHostOutcomeByOwner(owner string, sub Subscriber) Subscription
func NewSpawnhostExpirationSubscription ¶
func NewSpawnhostExpirationSubscription(owner string, sub Subscriber) Subscription
func NewSubscriptionByID ¶
func NewSubscriptionByID(resourceType, trigger, id string, sub Subscriber) Subscription
func NewSubscriptionByOwner ¶
func NewSubscriptionByOwner(owner string, sub Subscriber, resourceType, trigger string) Subscription
func (*Subscription) String ¶
func (s *Subscription) String() string
func (*Subscription) UnmarshalBSON ¶
func (d *Subscription) UnmarshalBSON(in []byte) error
func (*Subscription) Upsert ¶
func (s *Subscription) Upsert() error
func (*Subscription) Validate ¶
func (s *Subscription) Validate() error
type TaskEventData ¶
type TaskEventData struct { Execution int `bson:"execution" json:"execution"` HostId string `bson:"h_id,omitempty" json:"host_id,omitempty"` UserId string `bson:"u_id,omitempty" json:"user_id,omitempty"` Status string `bson:"s,omitempty" json:"status,omitempty"` JiraIssue string `bson:"jira,omitempty" json:"jira,omitempty"` Timestamp time.Time `bson:"ts,omitempty" json:"timestamp,omitempty"` Priority int64 `bson:"pri,omitempty" json:"priority,omitempty"` }
implements Data
type TaskQueueInfo ¶
type UnmarshalEventLogEntry ¶
type UnmarshalEventLogEntry struct { ID interface{} `bson:"_id" json:"-"` ResourceType string `bson:"r_type,omitempty" json:"resource_type,omitempty"` ProcessedAt time.Time `bson:"processed_at" json:"processed_at"` Timestamp time.Time `bson:"ts" json:"timestamp"` ResourceId string `bson:"r_id" json:"resource_id"` EventType string `bson:"e_type" json:"event_type"` Data mgobson.Raw `bson:"data" json:"data"` }
type VersionEventData ¶
type VersionEventData struct {
Status string `bson:"status,omitempty" json:"status,omitempty"`
}
type WebhookSubscriber ¶
func (*WebhookSubscriber) String ¶
func (s *WebhookSubscriber) String() string