// Events mocks base method
772072
func (m *MockCoreV1Interface) Events(arg0 string) v11.EventInterface {
	ret := m.ctrl.Call(m, "Events", arg0)
	ret0, _ := ret[0].(v11.EventInterface)
	return ret0
}
652129
func (handler *Handler) Event(logEvent *event.Event) error {
	handler.mutex.Lock()
	handler.events = append(handler.events, logEvent)
	handler.mutex.Unlock()
	return nil
}
421129
func (p *Project) Events(ctx context.Context, services ...string) (chan events.ContainerEvent, error) {
	events := make(chan events.ContainerEvent)
	if len(services) == 0 {
		services = p.ServiceConfigs.Keys()
	}
	// FIXME(vdemeester) handle errors (chan) here
	for _, service := range services {
		s, err := p.CreateService(service)
		if err != nil {
			return nil, err
		}
		go s.Events(ctx, events)
	}
	return events, nil
}
628807
func (r *Runc) Events(context context.Context, id string, interval time.Duration) (chan *Event, error) {
	cmd := r.command(context, "events", fmt.Sprintf("--interval=%ds", int(interval.Seconds())), id)
	rd, err := cmd.StdoutPipe()
	if err != nil {
		return nil, err
	}
	ec, err := Monitor.Start(cmd)
	if err != nil {
		rd.Close()
		return nil, err
	}
	var (
		dec = json.NewDecoder(rd)
		c   = make(chan *Event, 128)
	)
	go func() {
		defer func() {
			close(c)
			rd.Close()
			Monitor.Wait(cmd, ec)
		}()
		for {
			var e Event
			if err := dec.Decode(&e); err != nil {
				if err == io.EOF {
					return
				}
				e = Event{
					Type: "error",
					Err:  err,
				}
			}
			c <- &e
		}
	}()
	return c, nil
}
286971
func (el *eventLogger) Event(ctx context.Context, event string, metadata ...Loggable) {

	// short circuit if theres nothing to write to
	if !writer.WriterGroup.Active() {
		return
	}

	// Collect loggables for later logging
	var loggables []Loggable

	// get any existing metadata from the context
	existing, err := MetadataFromContext(ctx)
	if err != nil {
		existing = Metadata{}
	}
	loggables = append(loggables, existing)

	for _, datum := range metadata {
		loggables = append(loggables, datum)
	}

	e := entry{
		loggables: loggables,
		system:    el.system,
		event:     event,
	}

	accum := Metadata{}
	for _, loggable := range e.loggables {
		accum = DeepMerge(accum, loggable.Loggable())
	}

	// apply final attributes to reserved keys
	// TODO accum["level"] = level
	accum["event"] = e.event
	accum["system"] = e.system
	accum["time"] = FormatRFC3339(time.Now())

	var buf bytes.Buffer
	encoder := json.NewEncoder(&buf)
	encoder.SetEscapeHTML(false)
	err = encoder.Encode(accum)
	if err != nil {
		el.Errorf("ERROR FORMATTING EVENT ENTRY: %s", err)
		return
	}

	writer.WriterGroup.Write(buf.Bytes())
}
800784
func newEvents(c *CoreClient, namespace string) *events {
	return &events{
		client: c,
		ns:     namespace,
	}
}
1225178
func (m *rekeyFSM) Event(event RekeyEvent) {
	select {
	case m.reqs <- event:
	case <-m.shutdownCh:
	}
}
258631
func (r *BotService) Events(botId string) *BotEventsCall {
	c := &BotEventsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.botId = botId
	return c
}
1089617
func (c *Client) Event(e *Event) error {
	if c == nil {
		return fmt.Errorf("Client is nil")
	}
	stat, err := e.Encode(c.Tags...)
	if err != nil {
		return err
	}
	return c.sendMsg([]byte(stat))
}
1081659
func (c *CircularBuffer) Events() []Event {
	c.Lock()
	defer c.Unlock()
	return c.eventsCopy()
}
40034
func (handler *WriterHandler) Event(logEvent *event.Event) error {
	//handler.Output.Write([]byte(fmt.Sprintf("%#v\n", event)))
	var templateBuffer bytes.Buffer
	handler.Template.Execute(&templateBuffer, formatter.EventFormatter(logEvent))
	templateBuffer.WriteByte('\n')
	handler.Output.Write(templateBuffer.Bytes())

	return nil
}
785339
func (mr *MockSystemAPIClientMockRecorder) Events(ctx, options interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Events", reflect.TypeOf((*MockSystemAPIClient)(nil).Events), ctx, options)
}
178309
func (h *HTTPSink) AddEvents(ctx context.Context, events []*event.Event) (err error) {
	if len(events) == 0 || h.EventEndpoint == "" {
		return nil
	}
	return h.doBottom(ctx, func() (io.Reader, bool, error) {
		return h.encodePostBodyProtobufV2Events(events)
	}, "application/x-protobuf", h.EventEndpoint, datapointAndEventResponseValidator)
}
541636
func (q *Queue) Events() EventMask {
	ret := EventMask(0)

	q.mu.RLock()
	for e := q.list.Front(); e != nil; e = e.Next() {
		ret |= e.mask
	}
	q.mu.RUnlock()

	return ret
}
886486
func (e *Element) LoadEvents() {
	if e.eventManager != nil {
		e.eventManager.DisconnectRemoved()
		// log.Printf("will load events: %s %+s", e.Name(), e.events)

		for _, ev := range e.events {
			if es, _ := e.eventManager.NewEventMeta(ev.Meta); es != nil {
				es.Bind(ev.Fx)
			}
		}

	}

	//load up the children events also
	for _, ech := range e.children {
		if !ech.UseEventManager(e.eventManager) {
			ech.LoadEvents()
		}
	}
}
323780
func isRollbackEvent(e *api.Event) (bool, string) {
	rollbackEventReasons := []string{deploymentutil.RollbackRevisionNotFound, deploymentutil.RollbackTemplateUnchanged, deploymentutil.RollbackDone}
	for _, reason := range rollbackEventReasons {
		if e.Reason == reason {
			if reason == deploymentutil.RollbackDone {
				return true, "rolled back"
			}
			return true, fmt.Sprintf("skipped rollback (%s: %s)", e.Reason, e.Message)
		}
	}
	return false, ""
}
859513
func (s *EventService) DeleteEvents(p *DeleteEventsParams) (*DeleteEventsResponse, error) {
	resp, err := s.cs.newRequest("deleteEvents", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteEventsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}