gatewayd
gatewayd copied to clipboard
Improve parameter and error handling of plugins
Currently errors are passed as a string to the plugins and other parameters are passed by casting of different complex types to their primitive counterparts. This needs to be improved by introducing gob or some other flexible way to handle the data and the schema.
Upon investigation I found out that the errors can be passed either as gRPC status or some other ways. On the other hand, the protobuf is enough for most of the what I need to do in this project, at least for now when optimization is not a concern or objective. This is true, until optimization becomes the objective of a milestone.
This needs triage to be done at a later time. I'll remove it from v0.2.0 milestone.
At this point, the plugins use v1.Struct, which is an extension of google.protobuf.Struct that supports bytes, that is JSON with bytes support. This handles most of the cases. Let's optimize error handling later.