feat: upgrade core to v0.4.0, pass network to admission, add dial options
Upgrade github.com/go-gost/core from v0.3.3 to v0.4.0, adapting to interface changes: - Admit(ctx, network, addr, opts) now accepts a network parameter - Router.Dial now accepts variadic chain.DialOption, forwarded to the route's Dial call along with router-level options - gRPC/HTTP admission plugins include the new Network field Also fix two typos: ResoloverNodeOption -> ResolverNodeOption, WithHostOpton -> WithHostOption.
This commit is contained in:
@@ -43,7 +43,7 @@ func NewGRPCPlugin(name string, addr string, opts ...plugin.Option) admission.Ad
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *grpcPlugin) Admit(ctx context.Context, addr string, opts ...admission.Option) bool {
|
||||
func (p *grpcPlugin) Admit(ctx context.Context, network, addr string, opts ...admission.Option) bool {
|
||||
if p.client == nil {
|
||||
return false
|
||||
}
|
||||
@@ -56,6 +56,7 @@ func (p *grpcPlugin) Admit(ctx context.Context, addr string, opts ...admission.O
|
||||
r, err := p.client.Admit(ctx,
|
||||
&proto.AdmissionRequest{
|
||||
Service: options.Service,
|
||||
Network: network,
|
||||
Addr: addr,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user