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,7 @@
package registry
import (
"context"
"net"
"github.com/go-gost/core/hosts"
@ -30,10 +31,10 @@ type hostsWrapper struct {
r *hostsRegistry
}
func (w *hostsWrapper) Lookup(network, host string) ([]net.IP, bool) {
func (w *hostsWrapper) Lookup(ctx context.Context, network, host string) ([]net.IP, bool) {
v := w.r.get(w.name)
if v == nil {
return nil, false
}
return v.Lookup(network, host)
return v.Lookup(ctx, network, host)
}