edge/pkg/app/server_module.go

20 lines
292 B
Go

package app
import (
"context"
"github.com/dop251/goja"
)
type ServerModuleFactory func(*Server) ServerModule
type ServerModule interface {
Name() string
Export(*goja.Object)
}
type InitializableModule interface {
ServerModule
OnInit(ctx context.Context, rt *goja.Runtime) error
}