// NewEvent creates a new event with the given title and text.  Error checking
// against these values is done at send-time, or upon running e.Check.
18745
func NewEvent(title, text string) *Event {
	return &Event{
		Title: title,
		Text:  text,
	}
}
766387
func NewEventReader(
	reader io.ReadCloser,
	payloadUnmarshaler protocol.PayloadUnmarshaler,
	unmarshalerForEventType func(string) (Unmarshaler, error),
) *EventReader {
	return &EventReader{
		reader:                  reader,
		decoder:                 eventstream.NewDecoder(reader),
		payloadUnmarshaler:      payloadUnmarshaler,
		unmarshalerForEventType: unmarshalerForEventType,
		payloadBuf:              make([]byte, 10*1024),
	}
}
960290
func (s *QueueConfigurationDeprecated) SetEvent(v string) *QueueConfigurationDeprecated {
	s.Event = &v
	return s
}
1286296
func (m *EventHandler) HandleEvent(ctx context.Context, event eh.Event) error {
	if m.Err != nil {
		return m.Err
	}
	m.Events = append(m.Events, event)
	m.Context = ctx
	m.Time = time.Now()
	m.Recv <- event
	return nil
}
231723
func NewConfirmationEvent(numConfs uint32, cancel func()) *ConfirmationEvent {
	return &ConfirmationEvent{
		Confirmed:    make(chan *TxConfirmation, 1),
		Updates:      make(chan uint32, numConfs),
		NegativeConf: make(chan int32, 1),
		Done:         make(chan struct{}, 1),
		Cancel:       cancel,
	}
}
228616
func NewEventSub(evtype, evtarget string) *EventSub {
	return &EventSub{
		EventMeta: &EventMetable{
			EventType:   evtype,
			EventTarget: evtarget,
		},
		Chains: ChainIdentity(),
	}
}
906374
func NewEvent(v interface{}) *Event {
	event := &Event{Time: time.Now()}
	switch v := v.(type) {
	case *Node:
		event.Type = EventTypeNode
		node := *v
		event.Node = &node
	case *Conn:
		event.Type = EventTypeConn
		conn := *v
		event.Conn = &conn
	case *Msg:
		event.Type = EventTypeMsg
		msg := *v
		event.Msg = &msg
	default:
		panic(fmt.Sprintf("invalid event type: %T", v))
	}
	return event
}
1089275
func NewConnectionEvent(connected bool, err DisconnectedError) *ConnectionEvent {
	return &ConnectionEvent{Connected: connected, Err: err}
}
121062
func (h *handler) HandleEvent(ctx context.Context, event eh.Event) error {
	select {
	case h.ch <- event:
	default:
		return fmt.Errorf("missed event: %s", event)
	}
	return nil
}
471962
func newEvent(data *textproto.MIMEHeader) (*AMIEvent, error) {
	if data.Get("Event") == "" {
		return nil, errNotEvent
	}
	ev := &AMIEvent{data.Get("Event"),
		strings.Split(data.Get("Privilege"), ","),
		make(map[string]string)}

	for k, v := range *data {
		if k == "Event" || k == "Privilege" {
			continue
		}
		ev.Params[k] = v[0]
	}
	return ev, nil
}
988506
func NewEventManager() EventManagers {
	em := EventManager{
		events:   make(map[string]EventSubs),
		attaches: make(map[EventManagers]bool),
	}

	return &em
}
533750
func NewEvent(eventType EventType, data EventData, timestamp time.Time) Event {
	return event{
		eventType: eventType,
		data:      data,
		timestamp: timestamp,
	}
}
550909
func (t *TextBar) HandleEvent(ev tcell.Event) bool {
	switch ev.(type) {
	case *EventWidgetContent:
		t.changed = true
		return true
	}
	return false
}
1163828
func (_m *DBClient) AddEvent(e models.Event) (string, error) {
	ret := _m.Called(e)

	var r0 string
	if rf, ok := ret.Get(0).(func(models.Event) string); ok {
		r0 = rf(e)
	} else {
		r0 = ret.Get(0).(string)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(models.Event) error); ok {
		r1 = rf(e)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
869731
func (w *Webhook) UpdateEvent() error {
	data, err := jsoniter.Marshal(w.HookEvent)
	w.Events = string(data)
	return err
}
130671
func (h *EventHandler) HandleEvent(ctx context.Context, event eh.Event) error {
	h.inbox <- event
	return nil
}
101171
func NewEventMouse(x, y int, btn ButtonMask, mod ModMask) *EventMouse {
	return &EventMouse{t: time.Now(), x: x, y: y, btn: btn, mod: mod}
}