Mortar

APIs

Mortar’s goal is to let you easily create gRPC and REST web services.

Mortar supports:

  • gRPC API: you need to define proto files and compile them, read more here.
  • RESTful API: can be implemented in several ways:
    • Using gRPC-Gateway, read more here.

      • Generate reverse-proxy from protos or via yaml.
      • You can also add custom routes to it.

        You can’t access runtime.ServeMux unless you create it yourself.

        Once you do, pass it during HTTP server build, using a dedicated SetCustomGRPCGatewayMux builder option.

        You will also need to use your own builder instead of a default one.

    • Register custom HTTP Handler/HandlerFunc(s) using a dedicated group.