github.com/angryronald/go-kit@v0.0.0-20240505173814-ff2bd9c79dbf/test/docker/kafka/kafka.go (about) 1 package kafka 2 3 // import ( 4 // "os" 5 // "os/exec" 6 // 7 8 // "github.com/sirupsen/logrus" 9 // ) 10 11 // func StartKafka() { 12 // // Define the command you want to run 13 // cmd := exec.Command("docker-compose", "up", "-d") 14 15 // // Set the working directory to the location of your docker-compose.yml file 16 // cmd.Dir = "." 17 18 // // Capture and print the command's output 19 // output, err := cmd.CombinedOutput() 20 // if err != nil { 21 // logrus.Debug("Error:", err) 22 // os.Exit(1) 23 // } 24 25 // logrus.Debug("Command Output:", string(output)) 26 27 // cmd = exec.Command("docker", "ps", "-a") 28 29 // // Capture and print the command's output 30 // output, err = cmd.CombinedOutput() 31 // if err != nil { 32 // logrus.Debug("Error:", err) 33 // os.Exit(1) 34 // } 35 36 // logrus.Debug("Command Output:", string(output)) 37 // } 38 39 // func StopKafka() { 40 // // Define the command you want to run 41 // cmd := exec.Command("docker-compose", "down") 42 43 // // Set the working directory to the location of your docker-compose.yml file 44 // cmd.Dir = "." 45 46 // // Capture and print the command's output 47 // output, err := cmd.CombinedOutput() 48 // if err != nil { 49 // logrus.Debug("Error:", err) 50 // os.Exit(1) 51 // } 52 53 // logrus.Debugf("Command Output:", string(output)) 54 // }