func CreateProxyURL(instance, endpoint string) *url.URL {
	if !strings.HasPrefix(instance, "http") {
		instance = "http://" + instance
	}
	u, err := url.Parse(instance)
	if err != nil {
		panic(err)
	}
	if u.Path == "" {
		u.Path = endpoint
	}
	return u
}
CreateProxyURL creates an URL as proxy URL
package kitworker
import (
	"net/url"
	"strings"
	"github.com/go-kit/kit/circuitbreaker"
	"github.com/go-kit/kit/endpoint"
	kitratelimit "github.com/go-kit/kit/ratelimit"
	"github.com/go-kit/kit/sd"
	"github.com/go-kit/kit/sd/lb"
	"github.com/go-kit/kit/tracing/opentracing"
	httptransport "github.com/go-kit/kit/transport/http"
	jujuratelimit "github.com/juju/ratelimit"
	stdopentracing "github.com/opentracing/opentracing-go"
	"github.com/sony/gobreaker"
)
type LoadBalancerF func(factory sd.Factory) lb.Balancer
type ClientOption struct {
	Host string
	Tracer stdopentracing.Tracer
	DisableCircuitBreaker bool
	CircuitBreaker *gobreaker.CircuitBreaker
	DisableRateLimiter bool
	QPS int
	RateLimiter *jujuratelimit.Bucket
	TransportOpts []httptransport.ClientOption
	Middlewares []endpoint.Middleware
	LoadBalancerCreator LoadBalancerF
}
func (c ClientOption) Configure(moduleName, funcName string) ([]endpoint.Middleware, []httptransport.ClientOption) {
	var transportOpts []httptransport.ClientOption
	var middlewares []endpoint.Middleware
	if !c.DisableCircuitBreaker {
		cb := c.CircuitBreaker
		if c.CircuitBreaker == nil {
			cb = gobreaker.NewCircuitBreaker(gobreaker.Settings{})
		}
		middlewares = append(middlewares, circuitbreaker.Gobreaker(cb))
	}
	if !c.DisableRateLimiter {
		rateLimiter := c.RateLimiter
		if c.RateLimiter == nil {
			rateLimiter = jujuratelimit.NewBucketWithRate(float64(c.QPS), int64(c.QPS))
		}
		middlewares = append(middlewares, kitratelimit.NewTokenBucketLimiter(rateLimiter))
	}
	if c.Tracer != nil {
		middlewares = append(middlewares, opentracing.TraceServer(c.Tracer, funcName))
	}
	if len(c.Middlewares) > 0 {
		middlewares = append(middlewares, c.Middlewares...)
	}
	if len(c.TransportOpts) > 0 {
		transportOpts = append(transportOpts, c.TransportOpts...)
	}
	return middlewares, transportOpts
}