Skip to content

Commit d69fc3a

Browse files
committed
New plugin possibilities (access to AppConfig)
1 parent c91b447 commit d69fc3a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

core.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func App(config *AppConfig) error { // creates the app and starts it
2626

2727
for _, pl := range config.Plugins {
2828

29-
err := pl.Init_plugin()
29+
err := pl.Init_plugin(config)
3030

3131
if err != nil {
3232
misc.ShowError(err.Error())

plugins/ts/ts-plugin.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"os"
55
"strings"
66

7+
alf "github.com/PiterWeb/Alf-Router"
78
"github.com/gzuidhof/tygo/tygo"
89
"golang.org/x/mod/modfile"
910
)
@@ -13,7 +14,7 @@ type TS_plugin struct {
1314
OutputFolder string
1415
}
1516

16-
func (plugin TS_plugin) Init_plugin() error {
17+
func (plugin TS_plugin) Init_plugin(_ *alf.AppConfig) error {
1718

1819
cwd, err := os.Getwd()
1920

types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type AppConfig struct {
4646
}
4747

4848
type Plugin interface {
49-
Init_plugin() error
49+
Init_plugin(*AppConfig) error
5050
}
5151

5252
type routes struct {

0 commit comments

Comments
 (0)