// Package events passes events between the parts of JobSearch that cause // them, such as the fetcher, and the parts that react to them, such as the // WebSocket hub, so neither depends on the other. It holds the event types // and their payloads. package events // OpportunitiesUpdated is published when a save stores new opportunities or // new releases of stored ones. Its payload is an OpportunitiesUpdatedPayload. const OpportunitiesUpdated = "OpportunitiesUpdated" // ---------- OpportunitiesUpdated ---------- // OpportunitiesUpdatedPayload lists the opportunities a save changed by UUID: // New were stored for the first time, and Updated were already stored and // gained at least one new release. Summary counts them. type OpportunitiesUpdatedPayload struct { New []string `json:"new"` Updated []string `json:"updated"` Summary OpportunitiesSummary `json:"summary"` } // OpportunitiesSummary counts the opportunities in an // OpportunitiesUpdatedPayload. type OpportunitiesSummary struct { New int `json:"new"` Updated int `json:"updated"` }