File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
2
2
3
3
import (
4
4
"context"
5
+ "fmt"
5
6
"net/http"
6
7
7
8
// Packages
@@ -32,7 +33,8 @@ type ServiceCommands struct {
32
33
}
33
34
34
35
type ServiceRunCommand struct {
35
- Router struct {
36
+ Plugins []string `help:"Plugin paths"`
37
+ Router struct {
36
38
httprouter.Config `embed:"" prefix:"router."` // Router configuration
37
39
} `embed:""`
38
40
Server struct {
@@ -62,6 +64,15 @@ type ServiceRunCommand struct {
62
64
// PUBLIC METHODS
63
65
64
66
func (cmd * ServiceRunCommand ) Run (app server.Cmd ) error {
67
+ // Load plugins
68
+ plugins , err := provider .LoadPluginsForPattern (cmd .Plugins ... )
69
+ if err != nil {
70
+ return err
71
+ }
72
+ for _ , plugin := range plugins {
73
+ fmt .Println ("TODO: Loaded plugins:" , plugin .Name ())
74
+ }
75
+
65
76
// Set the server listener and router prefix
66
77
cmd .Server .Listen = app .GetEndpoint ()
67
78
cmd .Router .Prefix = types .NormalisePath (cmd .Server .Listen .Path )
You can’t perform that action at this time.
0 commit comments