syntax = "proto3";

package calculator;

option go_package = "./generated";

service Calculator {
  rpc Add (Numbers) returns (Result);
  rpc Multiply (Numbers) returns (Result);

  rpc GetOperationHistory (Empty) returns (stream OperationHistory);
}

message Numbers {
  int32 a = 1;
  int32 b = 2;
}

message Result {
  int32 value = 1;
  string operation = 2;
}

message OperationHistory {
  string service_name = 1;
  repeated Operation operations = 2;
}

message Operation {
  string type = 1;
  int32 a = 2;
  int32 b = 3;
  int32 result = 4;
  string timestamp = 5;
}

message Empty {}