syntax="proto3";

package proto;
option go_package = "pkg/utils/grpc/mariadb/protogen";

// CommandService provides a method to execute commands in the pod.
service CommandService {
  // ExecuteCommand runs a command and returns its output.
  rpc ExecuteCommand (CommandRequest) returns (CommandResponse);
}

// CommandRequest defines the command to execute and authentication key.
message CommandRequest {
  string command = 1; // The command to run (e.g., "cat /scripts/seqno").
  bytes data = 2;  // backup job.
}

// CommandResponse contains the command output or error.
message CommandResponse {
  string status = 1; // "success" or "error".
  bytes output = 2;  // Integer output of the command (e.g., contents of /scripts/seqno).
  string error = 3;  // Error message, if any.
}

//    protoc --go_out=. --go-grpc_out=. --proto_path=./pkg/utils/grpc/mariadb/proto ./pkg/utils/grpc/mariadb/proto/api.proto