mirror of
https://github.com/its-a-feature/Mythic
synced 2026-06-08 14:55:38 +00:00
28 lines
661 B
Go
28 lines
661 B
Go
package rabbitmq
|
|
|
|
import (
|
|
"github.com/its-a-feature/Mythic/logging"
|
|
)
|
|
|
|
type ContainerOnStartMessage struct {
|
|
ContainerName string `json:"container_name"`
|
|
OperationID int `json:"operation_id"`
|
|
OperationName string `json:"operation_name"`
|
|
ServerName string `json:"server_name"`
|
|
APIToken string `json:"apitoken"`
|
|
}
|
|
|
|
func (r *rabbitMQConnection) SendContainerOnStart(onStartMessage ContainerOnStartMessage) error {
|
|
err := r.SendStructMessage(
|
|
MYTHIC_EXCHANGE,
|
|
GetContainerOnStartRoutingKey(onStartMessage.ContainerName),
|
|
"",
|
|
onStartMessage,
|
|
true,
|
|
)
|
|
if err != nil {
|
|
logging.LogError(err, "Failed to send message")
|
|
}
|
|
return err
|
|
}
|