Created
November 30, 2018 16:51
-
-
Save Bebbolus/062b03c2130077d49cc3b2f1f0877566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for _, v := range RoutesConf.Endpoints { | |
//load module: | |
plug, err := plugin.Open(v.Controller) | |
if err != nil { | |
kill(err) | |
} | |
//look up for an exported Controller type | |
symController, err := plug.Lookup("Controller") | |
if err != nil { | |
kill(err) | |
} | |
//check that loaded symbol is type Controller | |
var controller Controller | |
controller, ok := symController.(Controller) | |
if !ok { | |
kill("The Controller module have wrong type") | |
} | |
//define new middleware chain | |
var chain []Gate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment