syntax = "proto3";

package frontend;

option go_package = "frontend";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "github.com/weaveworks/common/httpgrpc/httpgrpc.proto";

option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;

service Frontend {
  // After calling this method, client enters a loop, in which it waits for
  // a "FrontendToClient" message and replies with single "ClientToFrontend" message.
  rpc Process(stream ClientToFrontend) returns (stream FrontendToClient) {};
}

enum Type {
  HTTP_REQUEST = 0;
  GET_ID = 1;
}

message FrontendToClient {
  httpgrpc.HTTPRequest httpRequest = 1;
  Type type = 2;
}

message ClientToFrontend {
  httpgrpc.HTTPResponse httpResponse = 1;
  string clientID = 2;
}
