2023-02-09 12:16:36 +01:00
|
|
|
package app
|
|
|
|
|
|
|
|
import (
|
2023-10-19 20:05:59 +02:00
|
|
|
"context"
|
|
|
|
|
2023-02-09 12:16:36 +01:00
|
|
|
"github.com/dop251/goja"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ServerModuleFactory func(*Server) ServerModule
|
|
|
|
|
|
|
|
type ServerModule interface {
|
|
|
|
Name() string
|
|
|
|
Export(*goja.Object)
|
|
|
|
}
|
|
|
|
|
|
|
|
type InitializableModule interface {
|
|
|
|
ServerModule
|
2023-10-19 20:05:59 +02:00
|
|
|
OnInit(ctx context.Context, rt *goja.Runtime) error
|
2023-02-09 12:16:36 +01:00
|
|
|
}
|