Closed freeeverett closed 2 months ago
At the moment no. This would mean introducing oppinionated 3rd party dependency.
You can always create small helper function to marshal messages and write them to response.
Something like that (I have not tried it)
func Protobuf(c echo.Context, statusCode int, message proto.Message) error {
b, err := proto.Marshal(message)
if err != nil {
return err
}
r := c.Response()
r.Header().Add(echo.HeaderContentType, "application/x-protobuf")
r.WriteHeader(statusCode)
_, err = r.Write(b)
return err
}
Thanks
Is there any plan to facilitate responses in the Protobuf data format?