gatewayd icon indicating copy to clipboard operation
gatewayd copied to clipboard

Improve parameter and error handling of plugins

Open mostafa opened this issue 2 years ago • 3 comments

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.

mostafa avatar Jan 02 '23 23:01 mostafa

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.

mostafa avatar Jan 06 '23 17:01 mostafa

This needs triage to be done at a later time. I'll remove it from v0.2.0 milestone.

mostafa avatar Jan 06 '23 17:01 mostafa

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.

mostafa avatar Oct 31 '23 22:10 mostafa