chore(pluigin): init pluugins

This commit is contained in:
bandl 2021-10-25 15:23:36 +08:00
parent 5d7df024e4
commit 19562221f9
2 changed files with 5 additions and 3 deletions

View File

@ -12,8 +12,9 @@ import (
func GetMiddlewareMap() map[string]plugins.PluginInterface {
mockPlugin := mockPlugin.NewPlugin()
return map[string]plugins.PluginInterface{
mockPlugin.Init()
return map[string]plugins.PluginInterface{
mockPlugin.Name(): mockPlugin,
}
}

View File

@ -14,9 +14,10 @@ import (
func GetMiddlewareMap() map[string]plugins.PluginInterface {
{%for dir in dirs %}
{{dir[0]}}:={{dir[0]}}.NewPlugin()
{%- endfor%}
{{dir[0]}}.Init()
{% endfor%}
return map[string]plugins.PluginInterface{
{%for dir in dirs %}
{%for dir in dirs -%}
{{dir[0]}}.Name():{{dir[0]}},
{%- endfor%}
}