Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins and stuff #4

Open
Southclaws opened this issue Aug 15, 2019 · 0 comments
Open

Plugins and stuff #4

Southclaws opened this issue Aug 15, 2019 · 0 comments

Comments

@Southclaws
Copy link
Owner

While playing with #2 I realised I'm going to have to write some kind of generic way to declare:

  1. things that contribute to props structs (via tags) at build-time
  2. 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!

  1. shall be called "Providers", this will probably come with a Provider interface at some point.
  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant