func Tagger2PbEntityEvent(event types.EntityEvent) (*pb.StreamTagsEvent, error) {
	entity := event.Entity
	entityID, err := Tagger2PbEntityID(entity.ID)
	if err != nil {
		return nil, err
	}

	var eventType pb.EventType
	switch event.EventType {
	case types.EventTypeAdded:
		eventType = pb.EventType_ADDED
	case types.EventTypeModified:
		eventType = pb.EventType_MODIFIED
	case types.EventTypeDeleted:
		eventType = pb.EventType_DELETED
	default:
		return nil, fmt.Errorf("invalid event type %q", event.EventType)
	}

	return &pb.StreamTagsEvent{
		Type: eventType,
		Entity: &pb.Entity{
			Id:                          entityID,
			HighCardinalityTags:         entity.HighCardinalityTags,
			OrchestratorCardinalityTags: entity.OrchestratorCardinalityTags,
			LowCardinalityTags:          entity.LowCardinalityTags,
			StandardTags:                entity.StandardTags,
		},
	}, nil
}
// Tagger2PbEntityEvent helper to convert a native EntityEvent type to its protobuf representation.
Tagger2PbEntityEvent helper to convert a native EntityEvent type to its protobuf representation.
// Tagger2PbEntityEvent helper to convert a native EntityEvent type to its protobuf representation .
func Tagger2PbEntityEvent(event types.EntityEvent) (*pb.StreamTagsEvent, error) {
	entity := event.Entity
	entityID, err := Tagger2PbEntityID(entity.ID)
	if err != nil {
		return nil, err
	}
	var eventType pb.EventType
	switch event.EventType {
	case types.EventTypeAdded:
		eventType = pb.EventType_ADDED
	case types.EventTypeModified:
		eventType = pb.EventType_MODIFIED
	case types.EventTypeDeleted:
		eventType = pb.EventType_DELETED
	default:
		return nil, fmt.Errorf("invalid event type %q", event.EventType)
	}
	return &pb.StreamTagsEvent{
		Type: eventType,
		Entity: &pb.Entity{
			Id:                          entityID,
			HighCardinalityTags:         entity.HighCardinalityTags,
			OrchestratorCardinalityTags: entity.OrchestratorCardinalityTags,
			LowCardinalityTags:          entity.LowCardinalityTags,
			StandardTags:                entity.StandardTags,
		},
	}, nil
}
func Tagger2PbEntityEvent ( event types . EntityEvent ) ( * pb . StreamTagsEvent , error ) { entity := event . Entity entityID , err := Tagger2PbEntityID ( entity . ID ) if err != nil { return nil , err } var eventType pb . EventType switch event . EventType { case types . EventTypeAdded : eventType = pb . EventType_ADDED case types . EventTypeModified : eventType = pb . EventType_MODIFIED case types . EventTypeDeleted : eventType = pb . EventType_DELETED default : return nil , fmt . Errorf ( " " , event . EventType ) } return & pb . StreamTagsEvent { Type : eventType , Entity : & pb . Entity { Id : entityID , HighCardinalityTags : entity . HighCardinalityTags , OrchestratorCardinalityTags : entity . OrchestratorCardinalityTags , LowCardinalityTags : entity . LowCardinalityTags , StandardTags : entity . StandardTags , } , } , nil }
Tagger2PbEntityEvent helper to convert a native EntityEvent type to its protobuf representation.
Tagger2PbEntityEvent helper to convert a native EntityEvent type to its protobuf representation .