Beispiel #1
0
func (testRunner *TestRunner) sendProcessKillMessage() {
	id := common.GetUniqueId()
	message := &gauge_messages.Message{MessageId: &id, MessageType: gauge_messages.Message_KillProcessRequest.Enum(),
		KillProcessRequest: &gauge_messages.KillProcessRequest{}}

	conn.WriteGaugeMessage(message, testRunner.Connection)
}
Beispiel #2
0
func (plugin *plugin) sendMessage(message *gauge_messages.Message) error {
	messageId := common.GetUniqueId()
	message.MessageId = &messageId
	messageBytes, err := proto.Marshal(message)
	if err != nil {
		return err
	}
	err = conn.Write(plugin.connection, messageBytes)
	if err != nil {
		return errors.New(fmt.Sprintf("[Warning] Failed to send message to plugin: %d  %s", plugin.descriptor.Id, err.Error()))
	}
	return nil
}
Beispiel #3
0
func (handler *gaugeApiMessageHandler) getErrorMessage(err error) *gauge_messages.APIMessage {
	id := common.GetUniqueId()
	errorResponse := &gauge_messages.ErrorResponse{Error: proto.String(err.Error())}
	return &gauge_messages.APIMessage{MessageType: gauge_messages.APIMessage_ErrorResponse.Enum(), MessageId: &id, Error: errorResponse}
}
Beispiel #4
0
func uniqueFileName() string {
	return fmt.Sprintf("%d", common.GetUniqueId())
}