gitee.com/liuxuezhan/go-micro-v1.18.0@v1.0.0/util/http/http.go (about) 1 package http 2 3 import ( 4 "net/http" 5 6 "gitee.com/liuxuezhan/go-micro-v1.18.0/client/selector" 7 "gitee.com/liuxuezhan/go-micro-v1.18.0/registry" 8 ) 9 10 func NewRoundTripper(opts ...Option) http.RoundTripper { 11 options := Options{ 12 Registry: registry.DefaultRegistry, 13 } 14 for _, o := range opts { 15 o(&options) 16 } 17 18 return &roundTripper{ 19 rt: http.DefaultTransport, 20 st: selector.Random, 21 opts: options, 22 } 23 }