From 039ce627780b920fcfd8954dd80109a15707500a Mon Sep 17 00:00:00 2001 From: longXboy Date: Thu, 16 Sep 2021 10:35:48 +0800 Subject: [PATCH] remove http client call option:selectFilter --- transport/http/calloption.go | 19 ------------------- transport/http/client.go | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/transport/http/calloption.go b/transport/http/calloption.go index f68518952..7b0ed82d1 100644 --- a/transport/http/calloption.go +++ b/transport/http/calloption.go @@ -2,8 +2,6 @@ package http import ( "net/http" - - "github.com/go-kratos/kratos/v2/selector" ) // CallOption configures a Call before it starts or extracts information from @@ -22,7 +20,6 @@ type callInfo struct { contentType string operation string pathTemplate string - filters []selector.Filter } // EmptyCallOption does not alter the Call configuration. @@ -93,22 +90,6 @@ func (o PathTemplateCallOption) before(c *callInfo) error { return nil } -// SelectFilter is http select filter -func SelectFilter(filters ...selector.Filter) CallOption { - return SelectFilterCallOption{filters: filters} -} - -// SelectFilterCallOption is set call select filters -type SelectFilterCallOption struct { - EmptyCallOption - filters []selector.Filter -} - -func (o SelectFilterCallOption) before(c *callInfo) error { - c.filters = o.filters - return nil -} - // Header returns a CallOptions that retrieves the http response header // from server reply. func Header(header *http.Header) CallOption { diff --git a/transport/http/client.go b/transport/http/client.go index 14dc9a3b0..02542498c 100644 --- a/transport/http/client.go +++ b/transport/http/client.go @@ -238,7 +238,7 @@ func (client *Client) invoke(ctx context.Context, req *http.Request, args interf err error node selector.Node ) - if node, done, err = client.opts.selector.Select(ctx, selector.WithFilter(c.filters...)); err != nil { + if node, done, err = client.opts.selector.Select(ctx); err != nil { return nil, errors.ServiceUnavailable("NODE_NOT_FOUND", err.Error()) } if client.insecure {