use own fork

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-01-10 14:48:10 +03:00
parent 280d3a64c9
commit 59d77f7b8c
22 changed files with 812 additions and 866 deletions

View File

@@ -1,8 +1,8 @@
package http
import (
"github.com/micro/go-micro/v2/client"
"github.com/micro/go-micro/v2/codec"
"github.com/unistack-org/micro/v3/client"
"github.com/unistack-org/micro/v3/codec"
)
type httpRequest struct {
@@ -13,22 +13,19 @@ type httpRequest struct {
opts client.RequestOptions
}
func newHTTPRequest(service, method string, request interface{}, contentType string, reqOpts ...client.RequestOption) client.Request {
var opts client.RequestOptions
for _, o := range reqOpts {
o(&opts)
}
func newHTTPRequest(service, method string, request interface{}, contentType string, opts ...client.RequestOption) client.Request {
options := client.NewRequestOptions(opts...)
if len(opts.ContentType) > 0 {
contentType = opts.ContentType
if len(options.ContentType) == 0 {
options.ContentType = contentType
}
return &httpRequest{
service: service,
method: method,
request: request,
contentType: contentType,
opts: opts,
contentType: options.ContentType,
opts: options,
}
}
@@ -48,7 +45,7 @@ func (h *httpRequest) Endpoint() string {
return h.method
}
func (h *httpRequest) Codec() codec.Writer {
func (h *httpRequest) Codec() codec.Codec {
return nil
}