// Events listen for real time events from containers (of the project).
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
}
800784
func newEvents(c *CoreClient, namespace string) *events {
	return &events{
		client: c,
		ns:     namespace,
	}
}
107373
func (factory *TimeBeeFactory) Events() []bees.EventDescriptor {
	events := []bees.EventDescriptor{
		{
			Namespace:   factory.Name(),
			Name:        "time",
			Description: "The time has come ...",
			Options:     []bees.PlaceholderDescriptor{},
		},
	}
	return events
}
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()
		}
	}
}
1144640
func newEvents(c *EventsV1beta1Client, namespace string) *events {
	return &events{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
507207
func (factory *SpaceAPIBeeFactory) Events() []bees.EventDescriptor {
	events := []bees.EventDescriptor{
		{
			Namespace:   factory.Name(),
			Name:        "result",
			Description: "is triggered as soon as the query has been executed",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "open",
					Description: "open-state of the spaceapi instance that was queried",
					Type:        "bool",
				},
			},
		},
	}
	return events
}
876091
func (s *Service) SetEvents(v []*ServiceEvent) *Service {
	s.Events = v
	return s
}
216278
func (c *Client) SendEvents(events []Event, opts ...interface{}) (res StatusMessageRes, err error) {
	body := newSendEventsReq(events)
	err = c.transport.Request(&res, http.MethodPost, "/1/events", body, call.Write, opts...)
	return
}
1069660
func (b Backend) ProcessEvents(events ...*auditinternal.Event) bool {
	for _, event := range events {
		if event == nil {
			continue
		}
		attr, err := ev.NewAttributes(event)
		if err != nil {
			audit.HandlePluginError(PluginName, err, event)
			continue
		}
		level, stages := b.policyChecker.LevelAndStages(attr)
		if level == auditinternal.LevelNone {
			continue
		}
		// make shallow copy before modifying to satisfy interface definition
		ev := *event
		e, err := policy.EnforcePolicy(&ev, level, stages)
		if err != nil {
			audit.HandlePluginError(PluginName, err, event)
			continue
		}
		if e == nil {
			continue
		}
		b.delegateBackend.ProcessEvents(e)
	}
	// Returning true regardless of results, since dynamic audit backends
	// can never cause apiserver request to fail.
	return true
}
530292
func (u *UneventfulForwarder) AddEvents(ctx context.Context, events []*event.Event) error {
	return nil
}
1005021
func (factory *GitHubBeeFactory) Events() []bees.EventDescriptor {
	events := []bees.EventDescriptor{
		{
			Namespace:   factory.Name(),
			Name:        "push",
			Description: "Commits were pushed to a repository",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that something was pushed to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that pushed the commits",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the diff-view of the changes",
					Type:        "url",
				},
				{
					Name:        "event_id",
					Description: "ID of the GitHub event",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "commit",
			Description: "New commit in a repository",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that something was committed to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that authored the commit",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the diff-view of the commit",
					Type:        "url",
				},
				{
					Name:        "id",
					Description: "ID of the commit",
					Type:        "string",
				},
				{
					Name:        "message",
					Description: "Commit message",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "star",
			Description: "Someone starred a repository",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that was starred",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that starred the repository",
					Type:        "string",
				},
				{
					Name:        "event_id",
					Description: "ID of the GitHub event",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "fork",
			Description: "Someone forked a repository",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that was forked",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that forked the repository",
					Type:        "string",
				},
				{
					Name:        "event_id",
					Description: "ID of the GitHub event",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "issue_open",
			Description: "An issue was opened",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that the issue belongs to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that created the issue",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the issue on GitHub",
					Type:        "url",
				},
				{
					Name:        "id",
					Description: "ID of the issue",
					Type:        "int",
				},
				{
					Name:        "title",
					Description: "Issue title",
					Type:        "string",
				},
				{
					Name:        "text",
					Description: "Issue text",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "issue_close",
			Description: "An issue was closed",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that the issue belongs to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that closed the issue",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the issue on GitHub",
					Type:        "url",
				},
				{
					Name:        "id",
					Description: "ID of the issue",
					Type:        "int",
				},
				{
					Name:        "title",
					Description: "Issue title",
					Type:        "string",
				},
				{
					Name:        "text",
					Description: "Issue text",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "issue_comment",
			Description: "An issue was commented on",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that the issue belongs to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that commented on the issue",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the comment on GitHub",
					Type:        "url",
				},
				{
					Name:        "id",
					Description: "ID of the issue",
					Type:        "int",
				},
				{
					Name:        "text",
					Description: "Issue text",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "pullrequest_open",
			Description: "A Pull Request was created",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that the Pull Request belongs to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that opened the Pull Request",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the Pull Request on GitHub",
					Type:        "url",
				},
				{
					Name:        "id",
					Description: "ID of the Pull Request",
					Type:        "int",
				},
				{
					Name:        "title",
					Description: "Pull Request title",
					Type:        "string",
				},
				{
					Name:        "text",
					Description: "Pull Request text",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "pullrequest_close",
			Description: "A Pull Request was closed",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that the Pull Request belongs to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that closed the Pull Request",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the Pull Request on GitHub",
					Type:        "url",
				},
				{
					Name:        "id",
					Description: "ID of the Pull Request",
					Type:        "int",
				},
				{
					Name:        "title",
					Description: "Pull Request title",
					Type:        "string",
				},
				{
					Name:        "text",
					Description: "Pull Request text",
					Type:        "string",
				},
			},
		},
		{
			Namespace:   factory.Name(),
			Name:        "pullrequest_review_comment",
			Description: "A Pull Request commit was commented on",
			Options: []bees.PlaceholderDescriptor{
				{
					Name:        "public",
					Description: "Indicates whether this was a public activity",
					Type:        "string",
				},
				{
					Name:        "repo",
					Description: "The repository that the Pull Request belongs to",
					Type:        "string",
				},
				{
					Name:        "repo_url",
					Description: "The repository's URL",
					Type:        "url",
				},
				{
					Name:        "username",
					Description: "Username that commented on the Pull Request commit",
					Type:        "string",
				},
				{
					Name:        "url",
					Description: "URL to the comment on GitHub",
					Type:        "url",
				},
				{
					Name:        "id",
					Description: "ID of the Pull Request",
					Type:        "int",
				},
				{
					Name:        "text",
					Description: "Review text",
					Type:        "string",
				},
			},
		},
	}
	return events
}
833418
func (s *ListDeviceEventsOutput) SetEvents(v []*DeviceEvent) *ListDeviceEventsOutput {
	s.Events = v
	return s
}
56433
func (sm *StateMachine) Event(name string) *Event {
	event := &Event{Name: name}
	sm.events[name] = event
	return event
}
833679
func (s *eventLister) Events(namespace string) EventNamespaceLister {
	return eventNamespaceLister{indexer: s.indexer, namespace: namespace}
}
335257
func (s *EventsBatch) SetEvents(v map[string]*Event) *EventsBatch {
	s.Events = v
	return s
}
1174698
func (r *Recorder) Events() []Event {
	r.lock.Lock()
	defer r.lock.Unlock()
	copied := make([]Event, len(r.events))
	copy(copied, r.events)
	return copied
}
375789
func (sa *StubAPIClient) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) {
	sa.called()
	return sa.EventsFn(ctx, options)
}