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
While playing with #2 I realised I'm going to have to write some kind of generic way to declare:
things that contribute to props structs (via tags) at build-time
things that hydrate props at request-time
I'm also going to attempt to name these two concepts to make discussion, implementation and documentation easier!
shall be called "Providers", this will probably come with a Provider interface at some point.
shall be called "Extractors" because they extract information from requests!
A provider will be registered with the library (probably some singleton or something) and that provider will inform Pocket of a struct tag and a function to call when that struct tag is encountered in props. That function may return arbitrary metadata related to that field which can be recalled at request-time.
A provider must also supply an extractor which will get access to the incoming request and have the ability to write to the props reflect.Value field that it owns.
After this, I may implement the existing features as "plugins" to test the thing out.
The text was updated successfully, but these errors were encountered:
While playing with #2 I realised I'm going to have to write some kind of generic way to declare:
I'm also going to attempt to name these two concepts to make discussion, implementation and documentation easier!
Provider
interface at some point.A provider will be registered with the library (probably some singleton or something) and that provider will inform Pocket of a struct tag and a function to call when that struct tag is encountered in props. That function may return arbitrary metadata related to that field which can be recalled at request-time.
A provider must also supply an extractor which will get access to the incoming request and have the ability to write to the props
reflect.Value
field that it owns.After this, I may implement the existing features as "plugins" to test the thing out.
The text was updated successfully, but these errors were encountered: