micro/util/http/http.go

24 lines
379 B
Go
Raw Normal View History

2019-05-31 01:52:10 +03:00
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,
}
}