|
|
|
@ -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 { |
|
|
|
|