// New creates a new Mux without any routes or middleware.
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
}
971413
func New(m *GinJWTMiddleware) (*GinJWTMiddleware, error) {
	if err := m.MiddlewareInit(); err != nil {
		return nil, err
	}

	return m, nil
}
622866
func New(message string, field string, kind Kind) Error {
	return Error{message, field, 0, kind}
}
278510
func New(ctx context.Context, c *isolatedclient.Client, hash isolated.HexDigest,
	outputDir string, options *Options) *Downloader {

	var opt Options
	if options != nil {
		opt = *options
	}
	if opt.MaxConcurrentJobs == 0 {
		opt.MaxConcurrentJobs = 8
	}
	if opt.MaxFileStatsInterval == 0 {
		opt.MaxFileStatsInterval = time.Second * 5
	}

	interval := 100 * time.Millisecond
	if interval > opt.MaxFileStatsInterval {
		interval = opt.MaxFileStatsInterval
	}

	ctx2, cancel := context.WithCancel(ctx)
	ret := &Downloader{
		ctx:       ctx2,
		cancel:    cancel,
		c:         c,
		options:   opt,
		interval:  interval,
		dirCache:  stringset.New(0),
		rootHash:  hash,
		outputDir: normalizePathSeparator(outputDir),
		isoMap:    map[isolated.HexDigest]*isolated.Isolated{},
	}
	return ret
}
841001
func New(files Files) (vfs.FileSystem, error) {
	fs := make(MapFS)

	for path, file := range files {
		if err := fs.addFile(path, file); err != nil {
			return nil, err
		}
	}

	return fs, nil
}
997054
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
	return &Client{transport: transport, formats: formats}
}
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,
	}
}
510771
func New(u *url.URL, settings []vim.BaseOptionValue) (string, http.Handler) {
	s := &handler{
		ServeMux:    http.NewServeMux(),
		URL:         *u,
		Category:    make(map[string]*tags.Category),
		Tag:         make(map[string]*tags.Tag),
		Association: make(map[string]map[internal.AssociatedObject]bool),
		Session:     make(map[string]*session),
		Library:     make(map[string]content),
		Update:      make(map[string]update),
	}

	handlers := []struct {
		p string
		m http.HandlerFunc
	}{
		{internal.SessionPath, s.session},
		{internal.CategoryPath, s.category},
		{internal.CategoryPath + "/", s.categoryID},
		{internal.TagPath, s.tag},
		{internal.TagPath + "/", s.tagID},
		{internal.AssociationPath, s.association},
		{internal.AssociationPath + "/", s.associationID},
		{internal.LibraryPath, s.library},
		{internal.LocalLibraryPath, s.library},
		{internal.LibraryPath + "/", s.libraryID},
		{internal.LocalLibraryPath + "/", s.libraryID},
		{internal.LibraryItemPath, s.libraryItem},
		{internal.LibraryItemPath + "/", s.libraryItemID},
		{internal.LibraryItemUpdateSession, s.libraryItemUpdateSession},
		{internal.LibraryItemUpdateSession + "/", s.libraryItemUpdateSessionID},
		{internal.LibraryItemUpdateSessionFile, s.libraryItemUpdateSessionFile},
		{internal.LibraryItemUpdateSessionFile + "/", s.libraryItemUpdateSessionFileID},
		{internal.LibraryItemAdd + "/", s.libraryItemAdd},
		{internal.LibraryItemFilePath, s.libraryItemFile},
		{internal.LibraryItemFilePath + "/", s.libraryItemFileID},
		{internal.VCenterOVFLibraryItem + "/", s.libraryItemDeployID},
	}

	for i := range handlers {
		h := handlers[i]
		s.HandleFunc(internal.Path+h.p, func(w http.ResponseWriter, r *http.Request) {
			s.Lock()
			defer s.Unlock()

			if !s.isAuthorized(r) {
				w.WriteHeader(http.StatusUnauthorized)
				return
			}

			h.m(w, r)
		})
	}

	return internal.Path + "/", s
}
22228
func New(dsn string, pex bool) (*Amqp, error) {
	conn, ch, err := createConnAndChan(dsn)
	if err != nil {
		return nil, err
	}

	return &Amqp{
		conn:            conn,
		ch:              ch,
		passiveExchange: pex,
	}, nil
}
123109
func New(ctx context.Context, next http.Handler, name string) http.Handler {
	middlewares.GetLogger(ctx, name, typeName).Debug("Creating middleware")

	return &pipelining{
		next: next,
	}
}
782686
func New(ctx context.Context, next http.Handler, name string) (http.Handler, error) {
	middlewares.GetLogger(ctx, name, typeName).Debug("Creating middleware")

	return &compress{
		next: next,
		name: name,
	}, nil
}
478592
func New(m string, a ...interface{}) error {
	return errors.Wrap(fmt.Errorf(m, a...), 1)
}
527617
func New(channelNum, bitDepthInBytes int) *Mux {
	m := &Mux{
		channelNum:      channelNum,
		bitDepthInBytes: bitDepthInBytes,
		readers:         map[io.Reader]*bufio.Reader{},
	}
	runtime.SetFinalizer(m, (*Mux).Close)
	return m
}
335320
func (r *Request) Mux() *mux.Mux {
	mx := mux.New()
	r.Use(mx)
	return mx
}
288187
func New(address, facility string, extra map[string]interface{}, level logrus.Level) (logrus.Hook, error) {
	w, err := gelf.NewWriter(address)
	if err != nil {
		return nil, err
	}

	hostname, err := hostname()
	if err != nil {
		return nil, err
	}

	return &Hook{
		levels:   levelThreshold(level),
		w:        w,
		hostname: hostname,
		facility: facility,
		extra:    extra,
	}, err
}
125795
func New() *Router {
	r := &Router{}
	r.index = make(map[string]string)
	r.prefix = "/"
	r.router = httprouter.New()
	r.router.NotFound = http.HandlerFunc(r.notFoundHandler)

	return r
}
945322
func NewMux(opts ...muxOption) *Mux {
	m := &Mux{
		p:     pat.New(),
		added: make(map[string][]patternHandler),
	}
	for _, opt := range opts {
		opt(m)
	}
	return m
}