// New returns a new Store.
327767
func New(ln Listener, c *StoreConfig) *Store {
	logger := c.Logger
	if logger == nil {
		logger = log.New(os.Stderr, "[store] ", log.LstdFlags)
	}

	return &Store{
		ln:             ln,
		raftDir:        c.Dir,
		raftID:         c.ID,
		dbConf:         c.DBConf,
		dbPath:         filepath.Join(c.Dir, sqliteFile),
		randSrc:        rand.New(rand.NewSource(time.Now().UnixNano())),
		conns:          make(map[uint64]*Connection),
		done:           make(chan struct{}, 1),
		meta:           make(map[string]map[string]string),
		logger:         logger,
		ApplyTimeout:   applyTimeout,
		connPollPeriod: connectionPollPeriod,
	}
}
342585
func New() (interface{}, error) {
	db := new()
	dbType := dbplugin.NewDatabaseErrorSanitizerMiddleware(db, db.secretValues)

	return dbType, nil
}
462742
func New(items ...interface{}) *Set {
	s := &Set{}
	s.m = make(map[interface{}]struct{})

	// Ensure interface compliance
	var _ Interface = s

	s.Add(items...)
	return s
}
502638
func (m *mongoStore) New(r *http.Request, name string) (*gSessions.Session, error) {
	session := gSessions.NewSession(m, name)
	session.Options = &gSessions.Options{
		Path:   m.options.Path,
		MaxAge: m.options.MaxAge,
	}
	session.IsNew = true
	var err error
	if cook, errToken := m.Token.GetToken(r, name); errToken == nil {
		err = securecookie.DecodeMulti(name, cook, &session.ID, m.Codecs...)
		if err == nil {
			ok, err := m.load(session)
			session.IsNew = !(err == nil && ok) // not new if no error and data available
		}
	}
	return session, err
}
109813
func New(path string, mapping mapping.IndexMapping) (Index, error) {
	return newIndexUsing(path, mapping, Config.DefaultIndexType, Config.DefaultKVStore, nil)
}
1083071
func New(params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) {
	return getC().New(params)
}
602345
func (db *PGStore) New(r *http.Request, name string) (*sessions.Session, error) {
	session := sessions.NewSession(db, name)
	if session == nil {
		return nil, nil
	}

	opts := *db.Options
	session.Options = &(opts)
	session.IsNew = true

	var err error
	if c, errCookie := r.Cookie(name); errCookie == nil {
		err = securecookie.DecodeMulti(name, c.Value, &session.ID, db.Codecs...)
		if err == nil {
			err = db.load(session)
			if err == nil {
				session.IsNew = false
			} else if errors.Cause(err) == sql.ErrNoRows {
				err = nil
			}
		}
	}

	db.MaxAge(db.Options.MaxAge)

	return session, err
}
777469
func New(config Config) session.Store {
	s := &memoryStore{
		gcInterval: config.GCInterval,
		l:          make(map[interface{}]*item),
	}
	if s.gcInterval > 0 {
		time.AfterFunc(s.gcInterval, s.gcWorker)
	}
	return s
}
195782
func New(store session.Store, maxAttempts int) session.Store {
	if maxAttempts <= 0 {
		maxAttempts = 3
	}
	return &retryStore{
		store:       store,
		maxAttempts: maxAttempts,
	}
}
959440
func New(params *stripe.OrderParams) (*stripe.Order, error) {
	return getC().New(params)
}
870104
func New(groups ...string) *Store {
	s := &Store{
		groups: make(map[string]*group, len(groups)),
	}
	for _, name := range groups {
		g := &group{
			name:     name,
			entities: make(map[string][][]rune, DefaultGroupSize),
		}
		s.groups[name] = g
	}
	return s
}
291727
func New(robot *hal.Robot) (hal.Store, error) {
	c := &config{}
	env.MustProcess(c)
	s := &store{
		config: c,
	}
	s.SetRobot(robot)
	return s, nil
}
955906
func New(robot *hal.Robot) (hal.Store, error) {
	s := &store{
		data: map[string][]byte{},
	}
	s.SetRobot(robot)
	return s, nil
}
523707
func New() *Cache {
	return &Cache{
		nlocker: locker.NewLocker(),
		cache:   make(map[string]cacheEntry),
	}
}
897677
func (f FileSystemJSONLoaderFactory) New(source string) JSONLoader {
	return &jsonReferenceLoader{
		fs:     f.fs,
		source: source,
	}
}
874015
func New(r *uid.Range, factory allocator.AllocatorFactory) *Allocator {
	return &Allocator{
		r:     r,
		alloc: factory(int(r.Size()), r.String()),
	}
}
510228
func (l loader) New(ctx context.Context, url *backend.URL) (backend.Storage, error) {
	return New(), nil
}