This commit is contained in:
Asim Aslam
2019-05-30 23:52:10 +01:00
parent 8618183508
commit b4874806df
19 changed files with 687 additions and 8 deletions

23
util/http/http.go Normal file
View File

@@ -0,0 +1,23 @@
package http
import (
"net/http"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/selector"
)
func NewRoundTripper(opts ...Option) http.RoundTripper {
options := Options{
Registry: registry.DefaultRegistry,
}
for _, o := range opts {
o(&options)
}
return &roundTripper{
rt: http.DefaultTransport,
st: selector.Random,
opts: options,
}
}