// SoundStart is an event fired when any sound — recognisable speech or not
// — has been detected.
//
// https://developer.mozilla.org/docs/Web/Events/soundstart
351271
func SoundStart(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "soundstart", Listener: listener}
}
636395
func (s *DescribeActivitiesInput) SetStartTime(v time.Time) *DescribeActivitiesInput {
	s.StartTime = &v
	return s
}
192830
func (p *peer) OnStart() error {
	if err := p.BaseService.OnStart(); err != nil {
		return err
	}

	if err := p.mconn.Start(); err != nil {
		return err
	}

	go p.metricsReporter()
	return nil
}
1373530
func SoundEnd(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "soundend", Listener: listener}
}
895755
func (s *AttackSummary) SetStartTime(v time.Time) *AttackSummary {
	s.StartTime = &v
	return s
}
878215
func nextStart(p *xml.Decoder) (xml.StartElement, error) {
	for {
		t, err := p.Token()
		if err != nil {
			log.Fatal("token", err)
		}
		switch t := t.(type) {
		case xml.StartElement:
			return t, nil
		}
	}
	panic("unreachable")
}
362269
func (s *ContinuousExportDescription) SetStartTime(v time.Time) *ContinuousExportDescription {
	s.StartTime = &v
	return s
}
628109
func DragStart(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "dragstart", Listener: listener}
}
1329211
func (s *ListPublicKeysInput) SetStartTime(v time.Time) *ListPublicKeysInput {
	s.StartTime = &v
	return s
}
202490
func (s *TimePeriod) SetStart(v time.Time) *TimePeriod {
	s.Start = &v
	return s
}
976446
func parseStart(start string) (*periodicStart, error) {
	ps := &periodicStart{}
	ps.dayOfWeek = -1
	f := strings.Fields(start)

	switch len(f) {
	case 1: // no day provided
	case 2:
		if dow, ok := weekdays[strings.ToLower(f[0])]; ok {
			ps.dayOfWeek = dow
		} else {
			return nil, fmt.Errorf("invalid day of week %q", f[0])
		}
		// shift
		f = f[1:]
	default:
		return nil, fmt.Errorf("wrong number of fields")
	}

	n, err := fmt.Sscanf(f[0], "%d:%d", &ps.hourOfDay, &ps.minuteOfHour)

	// check Sscanf failure
	if n != 2 || err != nil {
		return nil, fmt.Errorf("invalid time of day %q: %v", f[0], err)
	}

	// check hour range
	if ps.hourOfDay < 0 || ps.hourOfDay > 23 {
		return nil, fmt.Errorf("invalid time of day %q: hour must be >= 0 and <= 23", f[0])
	}

	// check minute range
	if ps.minuteOfHour < 0 || ps.minuteOfHour > 59 {
		return nil, fmt.Errorf("invalid time of day %q: minute must be >= 0 and <= 59", f[0])
	}

	return ps, nil
}
854813
func (s *ServerRPC) PodStart(ctx context.Context, req *types.PodStartRequest) (*types.PodStartResponse, error) {
	err := s.daemon.StartPod(req.PodID)
	if err != nil {
		return nil, err
	}

	return &types.PodStartResponse{}, nil
}
106382
func (s *LookupEventsInput) SetStartTime(v time.Time) *LookupEventsInput {
	s.StartTime = &v
	return s
}
1159299
func (s *GetMetricStatisticsInput) SetStartTime(v time.Time) *GetMetricStatisticsInput {
	s.StartTime = &v
	return s
}
561084
func (s *SampleChannelDataInput) SetStartTime(v time.Time) *SampleChannelDataInput {
	s.StartTime = &v
	return s
}
1024678
func (wsc *wsConnection) OnStart() error {
	wsc.writeChan = make(chan types.RPCResponse, wsc.writeChanCapacity)

	// Read subscriptions/unsubscriptions to events
	go wsc.readRoutine()
	// Write responses, BLOCKING.
	wsc.writeRoutine()

	return nil
}
451093
func (is *IndexerService) OnStart() error {
	// Use SubscribeUnbuffered here to ensure both subscriptions does not get
	// cancelled due to not pulling messages fast enough. Cause this might
	// sometimes happen when there are no other subscribers.

	blockHeadersSub, err := is.eventBus.SubscribeUnbuffered(context.Background(), subscriber, types.EventQueryNewBlockHeader)
	if err != nil {
		return err
	}

	txsSub, err := is.eventBus.SubscribeUnbuffered(context.Background(), subscriber, types.EventQueryTx)
	if err != nil {
		return err
	}

	go func() {
		for {
			msg := <-blockHeadersSub.Out()
			header := msg.Data().(types.EventDataNewBlockHeader).Header
			batch := NewBatch(header.NumTxs)
			for i := int64(0); i < header.NumTxs; i++ {
				msg2 := <-txsSub.Out()
				txResult := msg2.Data().(types.EventDataTx).TxResult
				if err = batch.Add(&txResult); err != nil {
					is.Logger.Error("Can't add tx to batch",
						"height", header.Height,
						"index", txResult.Index,
						"err", err)
				}
			}
			if err = is.idr.AddBatch(batch); err != nil {
				is.Logger.Error("Failed to index block", "height", header.Height, "err", err)
			} else {
				is.Logger.Info("Indexed block", "height", header.Height)
			}
		}
	}()
	return nil
}