func (eClient *EventClient) PostHeartBeat(hEvent *HeartBeatEvent) error {
	event := cloudevents.NewEvent()
	event.SetID(uuid.New().String())
	event.SetType("no.met.mms.heartbeat.v1")
	event.SetTime(time.Now())
	event.SetSource("heartBeat")
	event.SetSubject("heartBeat")

	err := event.SetData("application/json", hEvent)
	if err != nil {
		return fmt.Errorf("failed to properly encode event data for heartbeat event: %v", err)
	}

	if result := eClient.ceClient.Send(context.Background(), event); cloudevents.IsUndelivered(result) {
		return fmt.Errorf("failed to send: %v", result.Error())
	}

	return nil
}
// PostProductEvent generates an event and sends it to the specified messaging service.
PostProductEvent generates an event and sends it to the specified messaging service.
// PostProductEvent generates an event and sends it to the specified messaging service .
func (eClient *EventClient) PostHeartBeat(hEvent *HeartBeatEvent) error {
	event := cloudevents.NewEvent()
	event.SetID(uuid.New().String())
	event.SetType("no.met.mms.heartbeat.v1")
	event.SetTime(time.Now())
	event.SetSource("heartBeat")
	event.SetSubject("heartBeat")
	err := event.SetData("application/json", hEvent)
	if err != nil {
		return fmt.Errorf("failed to properly encode event data for heartbeat event: %v", err)
	}
	if result := eClient.ceClient.Send(context.Background(), event); cloudevents.IsUndelivered(result) {
		return fmt.Errorf("failed to send: %v", result.Error())
	}
	return nil
}
func ( eClient * EventClient ) PostHeartBeat ( hEvent * HeartBeatEvent ) error { event := cloudevents . NewEvent ( ) event . SetID ( uuid . New ( ) . String ( ) ) event . SetType ( " " ) event . SetTime ( time . Now ( ) ) event . SetSource ( " " ) event . SetSubject ( " " ) err := event . SetData ( " " , hEvent ) if err != nil { return fmt . Errorf ( " " , err ) } if result := eClient . ceClient . Send ( context . Background ( ) , event ) ; cloudevents . IsUndelivered ( result ) { return fmt . Errorf ( " " , result . Error ( ) ) } return nil }
PostProductEvent generates an event and sends it to the specified messaging service.
PostProductEvent generates an event and sends it to the specified messaging service .