add plugin system

This commit is contained in:
ginuerzh
2023-04-18 20:52:56 +08:00
parent 7576651a67
commit 32c8188351
48 changed files with 761 additions and 115 deletions

View File

@ -1,6 +1,8 @@
package registry
import (
"context"
"github.com/go-gost/core/admission"
)
@ -28,10 +30,10 @@ type admissionWrapper struct {
r *admissionRegistry
}
func (w *admissionWrapper) Admit(addr string) bool {
func (w *admissionWrapper) Admit(ctx context.Context, addr string) bool {
p := w.r.get(w.name)
if p == nil {
return false
}
return p.Admit(addr)
return p.Admit(ctx, addr)
}