You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One gap in the functionality of Planet Mercury over Planet Venus is the lack of a plugin/filter system.
I think this should be implemented in two ways:
A Go-based plugin system using the standard library's plugin package. This would be the most powerful method and would allow for the extension of the template system on top of giving ways to process entries. Having experimented with this, I'm not so sure it's a good idea. It requires the use of CGo. A better alternative would be to make use of net/rpc/jsonrpc and spin up small servers that can service requests to process entries. I'll need to work on what the interface will be, but initially, it'll probably be a single method called process that takes a serialised entry and returns a result along the same lines as the pipeline-based method.
An external method for processing entries. This would serialise entries as JSON to be read from stdin and read the result from stdout. The status could be used to determine whether the script was happy (0), wants the entry skipped (1), or is returning an error (2+, with the error serialised as JSON). I don't think it's a good idea to overload the semantics of the exit status like this now.
There's an opportunity for batching here, which could aid with filtering. I think the top level of the request and response should be an array of entries, even if the entries are just being passed through one-by-one. That way, if an entry should be skipped, omitting the entry will be enough.
The text was updated successfully, but these errors were encountered:
One gap in the functionality of Planet Mercury over Planet Venus is the lack of a plugin/filter system.
I think this should be implemented in two ways:
A Go-based plugin system using the standard library's plugin package. This would be the most powerful method and would allow for the extension of the template system on top of giving ways to process entries.Having experimented with this, I'm not so sure it's a good idea. It requires the use of CGo. A better alternative would be to make use of net/rpc/jsonrpc and spin up small servers that can service requests to process entries. I'll need to work on what the interface will be, but initially, it'll probably be a single method calledprocess
that takes a serialised entry and returns a result along the same lines as the pipeline-based method.stdin
and read the result fromstdout
.The status could be used to determine whether the script was happy (0), wants the entry skipped (1), or is returning an error (2+, with the error serialised as JSON).I don't think it's a good idea to overload the semantics of the exit status like this now.There's an opportunity for batching here, which could aid with filtering. I think the top level of the request and response should be an array of entries, even if the entries are just being passed through one-by-one. That way, if an entry should be skipped, omitting the entry will be enough.
The text was updated successfully, but these errors were encountered: