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

Discuss: Make SIRIS more Plugin Compatible. #3

Open
Dexus opened this issue Jul 18, 2017 · 5 comments
Open

Discuss: Make SIRIS more Plugin Compatible. #3

Dexus opened this issue Jul 18, 2017 · 5 comments

Comments

@Dexus
Copy link
Contributor

Dexus commented Jul 18, 2017

As I like the Idea from @theodesp to make SIRIS more compatible for plugins. Split it to more small pieces.

So now my Idea is to make the Plugins with a fix Interface API, Register functions and priority for the call of that functions.

Example:

type (
    Register(hookname string, function func, priority int) 
)

For an better RL example we can look to https://github.com/go-siris/siris/pull/45/files#diff-a397a070e184e3d63fa3d834b18b8b93R195
Something like this would be nice and good for us to Register those events/functions.

Then we can include this Plugins like

import (
    _ "example.com/siris-plugin/sessions"
)

The Plugin is register it self for the correct hook where it needed.

Additional you can register own hooks, like you need a basicauth for a party-route.

What did you think about this?

@Dexus
Copy link
Contributor Author

Dexus commented Jul 18, 2017

ping @theodesp, @Allendar, @Andersbiha, @godofdream, @go-siris/core

@Allendar
Copy link

I like the idea, but isn't a plugin (or hook) much lower level? BasicAuth mechanics sounds more like something that would be a Middleware, or would there be no distinction between those anymore?

@Dexus
Copy link
Contributor Author

Dexus commented Jul 23, 2017 via email

@Allendar
Copy link

What I notice most is that in many projects I don't use all the features of the framework at all. For some projects I don't need front-end, views or sockets at all. For others I only use sockets. Maybe kind of like the way the old contrib system worked, we strip core things from Siris and maybe provide some easy auto-install inclusion system so people can easily fetch one or more of our plugins that way? So say I want a blanco project I don't want it to load any extra dependencies. Then I can just add a View engine, a Session engine and a Websocket engine.

@Dexus
Copy link
Contributor Author

Dexus commented Jul 25, 2017

Maybe i can create in the next week a prototype for it. That shows how i would do it.

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

No branches or pull requests

2 participants