// New creates a new Router instance
431614
func New() Router {
	return &router{
		mutex:  &sync.RWMutex{},
		routes: make(map[string]*match),
	}
}
471894
func New(ctx context.Context, next http.Handler, config config.PassTLSClientCert, name string) (http.Handler, error) {
	middlewares.GetLogger(ctx, name, typeName).Debug("Creating middleware")

	return &passTLSClientCert{
		next: next,
		name: name,
		pem:  config.PEM,
		info: newTLSClientInfo(config.Info),
	}, nil
}
462973
func New(host string, transport *http.Transport) types.APIClient {
	return &client{
		Client: http.Client{
			Transport: transport,
		},
		host: host,
	}
}
527546
func NewRouter() *Router {
	r := &Router{
		root:               radix.New(),
		storagePrefix:      radix.New(),
		mountUUIDCache:     radix.New(),
		mountAccessorCache: radix.New(),
	}
	return r
}
229833
func New(addr string) *Client {
	return &Client{Address: addr, Client: &http.Client{}}
}
721993
func NewWithPrefix(ctx interface{}, pathPrefix string) *Router {
	r := New(ctx)
	r.pathPrefix = pathPrefix

	return r
}
674681
func New(w io.Writer) *Logger {
	logger := &Logger{Out: w}
	logger.SetLevel(DebugLevel)
	logger.SetTimeFormat("2006-01-02T15:04:05.000Z")
	logger.SetLogFormat("[%s] %s %s")

	logger.init = func(log Log, ctx *gear.Context) {
		log["Start"] = time.Now()
		log["IP"] = ctx.IP().String()
		log["Proto"] = ctx.Req.Proto
		log["Method"] = ctx.Method
		log["URI"] = ctx.Req.RequestURI
		if s := ctx.GetHeader(gear.HeaderOrigin); s != "" {
			log["Origin"] = s
		}
		if s := ctx.GetHeader(gear.HeaderReferer); s != "" {
			log["Referer"] = s
		}
		log["UserAgent"] = ctx.GetHeader(gear.HeaderUserAgent)
	}

	logger.consume = func(log Log, ctx *gear.Context) {
		end := time.Now()
		if t, ok := log["Start"].(time.Time); ok {
			log["Start"] = t.UTC().Format(logger.tf)
			log["Time"] = end.Sub(t) / 1e6 // ms
		}

		if s := ctx.GetHeader(gear.HeaderXRequestID); s != "" {
			log["XRequestID"] = s
		} else if s := ctx.Res.Get(gear.HeaderXRequestID); s != "" {
			log["XRequestID"] = s
		}

		if router := gear.GetRouterPatternFromCtx(ctx); router != "" {
			log["Router"] = fmt.Sprintf("%s %s", ctx.Method, router)
		}

		if str, err := log.Format(); err == nil {
			logger.Output(end, InfoLevel, str)
		} else {
			logger.Output(end, WarningLevel, log.String())
		}
	}
	return logger
}
174713
func New(mws ...Middleware) *Router {
	r := &Router{
		parent:           nil,
		hostrm:           newHostMatcher(),
		middlewares:      Middlewares{},
		namedMiddlewares: make(map[string]Middlewares),
		pool:             newCtxPool(),
	}
	r.Use(mws...)
	r.Configure(
		WithLogger(lionLogger),
		WithServer(&http.Server{
			ReadTimeout:  5 * time.Second,
			WriteTimeout: 10 * time.Second,
		}),
	)
	return r
}
1269391
func New(c *Config) (*Middleware, error) {
	if c == nil {
		return nil, ErrMissingConfig
	}
	if c.Secret == "" {
		return nil, ErrMissingSecret
	}
	if c.Auth == nil {
		return nil, ErrMissingAuthFunc
	}
	if c.Claims == nil {
		return nil, ErrMissingClaimsFunc
	}
	if c.IdentityField == "" {
		c.IdentityField = "email"
	}
	if c.VerifyField == "" {
		c.VerifyField = "password"
	}
	m := &Middleware{
		secret:        c.Secret,
		auth:          c.Auth,
		claims:        c.Claims,
		identityField: c.IdentityField,
		verifyField:   c.VerifyField,
	}
	return m, nil
}
708393
func New(endpoint *url.URL, client *http.Client) *Client {
	if client == nil {
		client = http.DefaultClient
	}

	if len(endpoint.Path) > 0 && !strings.HasSuffix(endpoint.Path, "/") {
		endpoint.Path = endpoint.Path + "/"
	}

	return &Client{client, endpoint, make(http.Header), endpoint.Query(), noOpCacher}
}
48297
func New() *LARS {

	l := &LARS{
		routeGroup: routeGroup{
			middleware: make(HandlersChain, 0),
		},
		trees: make(map[string]*node),
		contextFunc: func(l *LARS) Context {
			return NewContext(l)
		},
		mostParams:                 0,
		http404:                    []HandlerFunc{default404Handler},
		http405:                    []HandlerFunc{methodNotAllowedHandler},
		redirectTrailingSlash:      true,
		handleMethodNotAllowed:     false,
		automaticallyHandleOPTIONS: false,
	}

	l.routeGroup.lars = l
	l.pool.New = func() interface{} {

		c := l.contextFunc(l)
		b := c.BaseContext()
		b.parent = c

		return b
	}

	return l
}
338956
func New() *Mux {
	mux := Mux{
		ms: mStack{
			stack: make([]mLayer, 0),
			pool:  makeCPool(),
		},
		rt: router{
			routes:   make([]route, 0),
			notFound: parseHandler(http.NotFound),
		},
	}
	mux.ms.router = &mux.rt
	return &mux
}
1175191
func New() (*Conn, error) {
	c := new(Conn)

	if err := c.initConnection(); err != nil {
		return nil, err
	}

	return c, nil
}
471125
func New(sendErrorCallback func(ehttp.ResponseWriter, *http.Request, error), errorContentType string, recoverPanic bool, logger *log.Logger) *Router {
	return &Router{
		Router:       httprouter.New(),
		mux:          ehttp.NewServeMux(sendErrorCallback, errorContentType, recoverPanic, logger),
		recoverPanic: recoverPanic,
	}
}
840622
func New(address string, config *Config) (result *comm, err error) {
	// Establish an initial connection and connect
	result = &comm{
		config:  config,
		address: address,
	}

	if err = result.reconnect(); err != nil {
		result = nil
		return
	}

	return
}
1120067
func NewRouter(f *Fibre) *Router {
	return &Router{
		fibre:  f,
		routes: make(map[string][]*Route),
	}
}
1062695
func New(dsn string) (*Handler, error) {
	client, err := raven.New(dsn)
	if err != nil {
		return nil, errors.Wrap(err, "failed to create raven client")
	}

	return NewFromClient(client), nil
}