Code challenge
This repo contains 2 entry points.
cmd/grpcserver/main.go)
1. GRPC Server (The grpc server exposes two rpcs:
rpc SaveVLAN (VLAN) returns (SaveVLANResponse) {}
rpc GetVLANs (google.protobuf.Empty) returns (GetVLANsResponse) {}
The first stores the given VLAN in memory in an alphabetically ordered array (by id). The second retrieves the aforementioned array.
cmd/restserver/main.go)
2. REST Server (The REST server exposes a simple gateway to the GRPC server.
Task
The code to achieve the above is intentionally written impractically.
- Find and refactor any areas that could be improved.
- Add an rpc to the proto definition that allows the retrieval of a single VLAN by id.
- Implement the above rpc in our grpc handler & create a gateway REST handler that makes a call to this new rpc (in a similar fashion to the other gateway handlers).
- Dockerise and make these services configurable (e.g. ports/addresses/timeouts).
- Create kubernetes config to allow this to be deployed to a cluster.
- Ensure reasonably production ready (e.g. unit tests).
- Document how to run the services.