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
22
33import (
44 "context"
5+ "fmt"
56 "net/http"
67
78 // Packages
@@ -32,7 +33,8 @@ type ServiceCommands struct {
3233}
3334
3435type ServiceRunCommand struct {
35- Router struct {
36+ Plugins []string `help:"Plugin paths"`
37+ Router struct {
3638 httprouter.Config `embed:"" prefix:"router."` // Router configuration
3739 } `embed:""`
3840 Server struct {
@@ -62,6 +64,15 @@ type ServiceRunCommand struct {
6264// PUBLIC METHODS
6365
6466func (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+
6576 // Set the server listener and router prefix
6677 cmd .Server .Listen = app .GetEndpoint ()
6778 cmd .Router .Prefix = types .NormalisePath (cmd .Server .Listen .Path )
You can’t perform that action at this time.
0 commit comments