// policyEvents builds a map of events (by type), for all the events in this set of
// updates. There will be one event per type, containing all workload ids
// affected by that event. e.g. all automated workload will share an event.
10511
func policyEvents(us policy.Updates, now time.Time) map[string]event.Event {
	eventsByType := map[string]event.Event{}
	for workloadID, update := range us {
		for _, eventType := range policyEventTypes(update) {
			e, ok := eventsByType[eventType]
			if !ok {
				e = event.Event{
					ServiceIDs: []flux.ResourceID{},
					Type:       eventType,
					StartedAt:  now,
					EndedAt:    now,
					LogLevel:   event.LogLevelInfo,
				}
			}
			e.ServiceIDs = append(e.ServiceIDs, workloadID)
			eventsByType[eventType] = e
		}
	}
	return eventsByType
}
1219823
func FilterEvents(filter EventFilter, userdata interface{}) {
	context := newEventFilterCallbackContext(filter, userdata)
	C.filterEvents(context.cptr())
}
1032389
func (r *PolicyReactionEvent) Handle(res chan interface{}) {
	r.d.ReactToRuleUpdates(r.wg, r.epsToBumpRevision, r.endpointsToRegen, r.newRev)
}
1029582
func (v *version) Events() EventInformer {
	return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
1344944
func (s *SetLoadBalancerPoliciesForBackendServerInput) SetPolicyNames(v []*string) *SetLoadBalancerPoliciesForBackendServerInput {
	s.PolicyNames = v
	return s
}
673483
func (c *Client) monitorEvents() (EventMonitor, error) {
	if err := eventMonitor.run(c); err != nil {
		return nil, err
	}
	return eventMonitor, nil
}
571110
func (c *ClientupdateCountCall) EventType(eventType string) *ClientupdateCountCall {
	c.urlParams_.Set("eventType", eventType)
	return c
}
1074939
func (s *ListGroupPoliciesOutput) SetPolicyNames(v []*string) *ListGroupPoliciesOutput {
	s.PolicyNames = v
	return s
}
978950
func (e *Eventer) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error) {
	consumer := e.newConsumer(ctx)
	return consumer.ch, nil
}
1318212
func (s *ActivityService) ListEvents(ctx context.Context, opt *ListOptions) ([]*Event, *Response, error) {
	u, err := addOptions("events", opt)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	var events []*Event
	resp, err := s.client.Do(ctx, req, &events)
	if err != nil {
		return nil, resp, err
	}

	return events, resp, nil
}
1199187
func (self *FSock) eventsPlain(events []string) error {
	// if len(events) == 0 {
	// 	return nil
	// }
	eventsCmd := "event plain"
	customEvents := ""
	for _, ev := range events {
		if ev == "ALL" {
			eventsCmd = "event plain all"
			break
		}
		if strings.HasPrefix(ev, "CUSTOM") {
			customEvents += ev[6:] // will capture here also space between CUSTOM and event
			continue
		}
		eventsCmd += " " + ev
	}
	if eventsCmd != "event plain all" {
		eventsCmd += " BACKGROUND_JOB" // For bgapi
		if len(customEvents) != 0 {    // Add CUSTOM events subscribing in the end otherwise unexpected events are received
			eventsCmd += " " + "CUSTOM" + customEvents
		}
	}
	eventsCmd += "\n\n"
	self.send(eventsCmd)
	if rply, err := self.readHeaders(); err != nil {
		return err
	} else if !strings.Contains(rply, "Reply-Text: +OK") {
		self.Disconnect()
		return fmt.Errorf("Unexpected events-subscribe reply received: <%s>", rply)
	}
	return nil
}
748885
func ProjectEvents(p project.APIProject, c *cli.Context) error {
	evts, err := p.Events(context.Background(), c.Args()...)
	if err != nil {
		return err
	}
	var printfn func(events.ContainerEvent)

	if c.Bool("json") {
		printfn = printJSON
	} else {
		printfn = printStd
	}
	for event := range evts {
		printfn(event)
	}
	return nil
}
764600
func (c *containerAdapter) events(ctx context.Context) <-chan events.Message {
	log.G(ctx).Debugf("waiting on events")
	buffer, l := c.backend.SubscribeToEvents(time.Time{}, time.Time{}, c.container.eventFilter())
	eventsq := make(chan events.Message, len(buffer))

	for _, event := range buffer {
		eventsq <- event
	}

	go func() {
		defer c.backend.UnsubscribeFromEvents(l)

		for {
			select {
			case ev := <-l:
				jev, ok := ev.(events.Message)
				if !ok {
					log.G(ctx).Warnf("unexpected event message: %q", ev)
					continue
				}
				select {
				case eventsq <- jev:
				case <-ctx.Done():
					return
				}
			case <-ctx.Done():
				return
			}
		}
	}()

	return eventsq
}
824351
func (s Status) Event_type() string {
	switch s.String() {
	case TPL_HOSTINFOS_RUN:
		return OBCHOSTINFOSTPLRUN
	case TPL_HOSTINFOS_FINISHED:
		return OBCHOSTINFOSTPLFINISHED
	case CMD_GETCONFIG_BEGIN:
		return OBCHOSTINFOSCONFIGPARSING
	case CMD_GETCONFIG_END:
		return OBCHOSTINFOSCONFIGPARSED
	case CMD_KVMCHECK_BEGIN:
		return OBCHOSTINFOSKVMCHECKPARSING
	case CMD_KVMCHECK_END:
		return OBCHOSTINFOSKVMCHECKPARSED
	case TPL_VERTICE_RUN:
		return OBCVERTICETPLRUN
	case VERTICE_INSTALL_BEGIN:
		return OBCVERTICEINSTALLINGTYPE
	case VERTICE_INSTALL_END:
		return OBCVERTICEINSTALLEDTYPE
	case TPL_VERTICE_FINISHED:
		return OBCVERTICETPLFINISHED
	case TPL_VERTICEGATEWAY_RUN:
		return OBCVERTICEGATEWAYTPLRUN
	case GATEWAY_INSTALL_BEGIN:
		return OBCVERTICEGATEWAYINSTALLINGTYPE
	case GATEWAY_INSTALL_END:
		return OBCVERTICEGATEWAYINSTALLEDTYPE
	case TPL_VERTICEGATEWAY_FINISHED:
		return OBCVERTICEGATEWAYTPLFINISHED
	case TPL_VERTICENILAVU_RUN:
		return OBCVERTICENILAVUTPLRUN
	case NILAVU_INSTALL_BEGIN:
		return OBCVERTICENILAVUINSTALLINGTYPE
	case NILAVU_INSTALL_END:
		return OBCVERTICENILAVUINSTALLEDTYPE
	case TPL_VERTICENILAVU_FINISHED:
		return OBCVERTICENILAVUTPLFINISHED
	case TPL_ONEMASTER_RUN:
		return OBCONEMASTERTPLRUN
	case ONEMASTER_INSTALL_BEGIN:
		return OBCONEMASTERINSTALLINGTYPE
	case ONEMASTER_INSTALL_END:
		return OBCONEMASTERINSTALLEDTYPE
	case ONEMASTER_ACTIVATE_BEGIN:
		return OBCONEMASTERACTIVATINGTYPE
	case ONEMASTER_ACTIVATE_END:
		return OBCONEMASTERACTIVATEDTYPE
	case TPL_ONEMASTER_FINISHED:
		return OBCONEMASTERTPLFINISHED
	case TPL_ONEHOST_RUN:
		return OBCONEHOSTTPLRUN
	case ONEHOST_PEPARE_BEGIN:
		return OBCONEHOSTPEPARINGTYPE
	case ONEHOST_PREPARE_END:
		return OBCONEHOST_PREPAREDTYPE
	case ONEHOST_INSTALL_BEGIN:
		return OBCONEHOSTINSTALLINGTYPE
	case ONEHOST_INSTALL_END:
		return OBCONEHOSTINSTALLEDTYPE
	case TPL_ONEHOST_FINISHED:
		return OBCONEHOSTTPLFINISHEDTYPE
	case TPL_CEPHCLUSTER_RUN:
		return OBCCEPHCLUSTERTPLRUN
	case CEPHCLUSTER_PREPARE_BEGIN:
		return OBCCEPHCLUSTERPREPAREINSTALLINGTYPE
	case CEPHCLUSTER_PREPARE_END:
		return OBCCEPHCLUSTERPREPAREINSTALLEDTYPE
	case CEPHCLUSTER_INSTALL_BEIGIN:
		return OBCCEPHCLUSTERINSTALLINGTYPE
	case CEPHCLUSTER_INSTALL_END:
		return OBCCEPHCLUSTERINSTALLEDTYPE
	case CEPHCLUSTER_ACCESS_BEGIN:
		return OBCCEPHCLUSTERACCESSENABLINGTYPE
	case CEPHCLUSTER_ACCESS_END:
		return OBCCEPHCLUSTERACCESSENABLEDTYPE
	case CEPHCLUSTER_NEW_BEGIN:
		return OBCCEPHCLUSTERNEWCREATINGTYPE
	case CEPHCLUSTER_NEW_END:
		return OBCCEPHCLUSTERNEWCREATEDTYPE
	case CEPHCLUSTER_CONFIG_BEGIN:
		return OBCCEPHCLUSTERCONFIGURINGTYPE
	case CEPHCLUSTER_CONFIG_END:
		return OBCCEPHCLUSTERCONFIGUREDTYPE
	case CEPHCLUSTER_MON_BEGIN:
		return OBCCEPHCLUSTERMONINITIALINGTYPE
	case CEPHCLUSTER_MON_END:
		return OBCCEPHCLUSTERMONINITIALIZEDTYPE
	case CEPHCLUSTER_CREATEPOOL_BEGIN:
		return OBCCEPHCLUSTERPOOLCREATINGTYPE
	case CEPHCLUSTER_CREATEPOOL_END:
		return OBCCEPHCLUSTERPOOLCREATEDTYPE
	case TPL_CEPHCLUSTER_FINISHED:
		return OBCCEPHCLUSTERTPLFINISHED
	case TPL_CEPHCLIENT_RUN:
		return OBCCEPHCLIENTTPLRUN
	case CEPHCLIENT_INSTALL_BEGIN:
		return OBCCEPHCLIENTINSTALLING
	case CEPHCLIENT_INSTALL_END:
		return OBCCEPHCLIENTINSTALLED
	case TPL_CEPHCLIENT_FINISHED:
		return OBCCEPHCLIENTTPLFINISHED
	case TPL_ADDOSDS_RUN:
		return OBCADDOSDSTPLRUN
	case OSDS_ACTIVATE_BEGIN:
		return OBCOSDSACTIVATINGTYPE
	case OSDS_ACTIVATE_END:
		return OBCOSDSACTIVATEDTYPE
	case OSDS_PREPARE_BEGIN:
		return OBCOSDSPREPARINGTYPE
	case OSDS_PREPARE_END:
		return OBCOSDSPREPAREDTYPE
	case TPL_ADDOSDS_FINISHED:
		return OBCADDOSDSTPLFINISHED
	case TPL_DSCONNECTION_RUN:
		return OBCCEPHDSCONNECTIONTPLRUN
	case CEPHDS_AUTHKEY_BEGIN:
		return OBCCEPHDSAUTHKEYCREATINGTYPE
	case CEPHDS_AUTHKEY_END:
		return OBCCEPHDSAUTHKEYCREATEDTYPE
	case CEPHDS_DEFINEKEY_BEGIN:
		return OBCCEPHDSAUTHKEYDEFININGTYPE
	case CEPHDS_DEFINEKEY_END:
		return OBCCEPHDSAUTHKEYDEFINEDTYPE
	case TPL_DSCONNECTION_FINISHED:
		return OBCCEPHDSCONNECTIONTPLFINISHED
	case TPL_CEPHACCESS_RUN:
		return OBCCEPHACCESSTPLRUN
	case CEPHACCESS_PASSWORD_BEGIN:
		return OBCCEPHACCESSPASSAUTHENDICATINGTYPE
	case CEPHACCESS_PASSWORD_END:
		return OBCCEPHACCESSPASSAUTHENDICATEDTYPE
	case CEPHACCESS_KEY_BEGIN:
		return OBCCEPHACCESSKEYAUTHENDICATINGTYPE
	case CEPHACCESS_KEY_END:
		return OBCCEPHACCESSKEYAUTHENDICATEDTYPE
	case TPL_CEPHACCESS_FINISHED:
		return OBCCEPHACCESSTPLFINISHED
	case TPL_ZAPDISK_RUN:
		return OBCZAPDISKTPLRUN
	case ZAPDISKS_CLEAN_BEGIN:
		return OBCZAPDISKSCLEANINGTYPE
	case ZAPDISKS_CLEAN_END:
		return OBCZAPDISKSCLEANEDTYPE
	case TPL_ZAPDISK_FINISHED:
		return OBCZAPDISKTPLFINISHED
	case TPL_KVMNETWORK_RUN:
		return OBCKVMNETWORKTPLRUN
	case KVMNETWORK_CONFIG_BEGIN:
		return OBCKVMNETWORKCONFIGURINGTYPE
	case KVMNETWORK_CONFIG_END:
		return OBCKVMNETWORKCONFIGUREDTYPE
	case TPL_KVMNETWORK_FINISHED:
		return OBCKVMNETWORKTPLFINISHED
	case TPL_LVMINSTALL_RUN:
		return OBCLVMTPLRUN
	case LVM_INSTALL_BEGIN:
		return OBCLVM_INSTALLINGTYPE
	case LVM_INSTALL_END:
		return OBCLVMINSTALLEDTYPE
	case TPL_LVMINSTALL_FINISHED:
		return OBCLVMTPLFINISHED
	case TPL_NETWORKINFO_RUN:
		return OBCNETWORKINFOTPLRUN
	case GETNETWORK_INFOS_BEGIN:
		return OBCGETNETWORKINFOSGATHERINGTYPE
	case GETNETWORK_INFOS_END:
		return OBCGETNETWORKINFOSGATHEREDTYPE
	case TPL_NETWORKINFO_FINISHED:
		return OBCNETWORKINFOTPLFINISHED
	case RUNNING:
		return OBCHOSTINSTALLRUNNINGTYPE
	case HOSTRUNNING:
		return OBCHOSTINSTALLRUNNINGTYPE
	case MASTERRUNNING:
		return OBCHOSTINSTALLRUNNINGTYPE
	case NETWORKERROR:
		return OBCNETWORKERRORTYPE
	case STORAGEERROR:
		return OBCSTORAGEERRORTYPE
	case COMPUTEERROR:
		return OBCCOMPUTEERRORTYPE
	case PREERROR:
		return OBCTEMPLATEPREERRORTYPE
	case POSTERROR:
		return OBCTEMPLATEPOSTERRORTYPE
	case ERROR:
		return OBCTEPMLATEERRORTYPE
	default:
		return "arrgh"
	}
}
204888
func (e *RawV4Event) EventType() mysql_proto.LogEventType_Type {
	return mysql_proto.LogEventType_Type(e.header.EventType)
}
606484
func (h *eventHub) processEvents() {
	for {
		select {
		case connection := <-h.register:
			h.connections.Register(connection)
		case connection := <-h.unregister:
			h.connections.Unregister(connection)
		case msg := <-h.broadcast:
			h.connections.Broadcast(msg)
		}
	}
}
393710
func WithBlockEvents() options.Opt {
	return func(p options.Params) {
		if setter, ok := p.(permitBlockEventsSetter); ok {
			setter.PermitBlockEvents()
		}
	}
}