// NewDBConfig returns a new DB config instance.
335066
func NewDBConfig(dsn string, memory bool) *DBConfig {
	return &DBConfig{DSN: dsn, Memory: memory}
}
900022
func NewConfig(accessToken string) *Config {
	return &Config{
		HTTPClient:  http.DefaultClient,
		AccessToken: accessToken,
	}
}
1302360
func NewDB(path string) (*DB, error) {
	db := &DB{}

	valid, err := db.initBolt(path)
	if valid && err == nil {
		return db, nil
	}

	if !valid {
		log.Print("DB schema version is incorrect. Clearing db")
	}

	err = os.Remove(path)
	if err != nil {
		return nil, fmt.Errorf("Unable to remove db! Please manually remove %s",
			path)
	}

	valid, err = db.initBolt(path)
	if err != nil {
		return nil, err
	}

	if !valid {
		return nil, fmt.Errorf("Fatal error initializing db schema version")
	}

	return db, nil
}
342585
func New() (interface{}, error) {
	db := new()
	dbType := dbplugin.NewDatabaseErrorSanitizerMiddleware(db, db.secretValues)

	return dbType, nil
}
466881
func NewConfig() *Config {
	return &Config{
		stderr: new(broadcaster.Unbuffered),
		stdout: new(broadcaster.Unbuffered),
	}
}
95449
func (s *configsService) Config(db *gorm.DB, app *App) (*Config, error) {
	r, err := releasesFind(db, ReleasesQuery{App: app})
	if err != nil {
		if err == gorm.RecordNotFound {
			// It's possible to have config without releases, this handles that.
			c, err := configsFind(db, ConfigsQuery{App: app})
			if err != nil {
				if err == gorm.RecordNotFound {
					// Return an empty config.
					return &Config{
						AppID: app.ID,
						App:   app,
						Vars:  make(Vars),
					}, nil
				}
				return nil, err
			}

			return c, nil
		}

		return nil, err
	}

	return r.Config, nil
}
706623
func NewConfig(pkgPath, newPkgPath string, rules ...string) (*ConfigV1, error) {
	c := &ConfigV1{
		Import: pkgPath,
	}
	if strings.HasPrefix(newPkgPath, ".") {
		c.Local = true
		c.Name = strings.TrimPrefix(newPkgPath, ".")
	} else {
		c.Name = newPkgPath
	}

	typeMap, err := ParseTypeMap(rules)
	if err != nil {
		return nil, err
	}
	c.TypeMap = typeMap

	return c, nil
}
660262
func NewConfig(contextType TypeGetter, endpoints ...NamedTypeGetter) Config {
	res := Config{
		contextType:   contextType,
		endpointTypes: make(map[string]TypeGetter),
	}
	for _, e := range endpoints {
		res.endpointTypes[e.name] = e.typeGetter
	}
	return res
}
111300
func NewConfig() *Config {
	return &Config{
		Collation:            defaultCollation,
		Loc:                  time.UTC,
		MaxAllowedPacket:     defaultMaxAllowedPacket,
		AllowNativePasswords: true,
	}
}
290487
func NewConfig(
	loadGlobalConfig, loadUserConfig bool,
	configName, configType string) types.Config {
	return newConfigWithOptions(
		loadGlobalConfig, loadUserConfig, configName, configType)
}
1190032
func newConfig(cfg *config.Config) *environConfig {
	return &environConfig{
		Config: cfg,
		attrs:  cfg.UnknownAttrs(),
	}
}
1323966
func newDBConn(ops Options) (*ScyllaDB, error) {
	r, err := newScyllaDB(ScyllaDBOpts{
		KeySpaceName: ops.Keyspace,
		NodeIps:      ops.Hosts,
		Username:     ops.Username,
		Password:     ops.Password,
		Debug:        true,
	})
	if err != nil {
		return nil, err
	}
	return r, nil
}
682542
func NewConfig() Config {
	cfg := make(Config)
	cfg[Globals] = make(map[GlobalOption]string)
	return cfg
}
164839
func NewCacheConfig() CacheConfig {
	return CacheConfig{
		MaxMemorySize:             DefaultCacheMaxMemorySize,
		SnapshotMemorySize:        DefaultCacheSnapshotMemorySize,
		SnapshotAgeDuration:       DefaultCacheSnapshotAgeDuration,
		SnapshotWriteColdDuration: DefaultCacheSnapshotWriteColdDuration,
	}
}
776348
func NewConfig() (c *Config) {

	c = &Config{
		LocalStoreParams:     storage.NewDefaultLocalStoreParams(),
		FileStoreParams:      storage.NewFileStoreParams(),
		HiveParams:           network.NewHiveParams(),
		Swap:                 swap.NewDefaultSwapParams(),
		Pss:                  pss.NewPssParams(),
		ListenAddr:           DefaultHTTPListenAddr,
		Port:                 DefaultHTTPPort,
		Path:                 node.DefaultDataDir(),
		EnsAPIs:              nil,
		EnsRoot:              ens.TestNetAddress,
		NetworkID:            network.DefaultNetworkID,
		SwapEnabled:          false,
		SyncEnabled:          true,
		SyncingSkipCheck:     false,
		MaxStreamPeerServers: 10000,
		DeliverySkipCheck:    true,
		SyncUpdateDelay:      15 * time.Second,
		SwapAPI:              "",
	}

	return
}
868269
func (tqsc *Controller) InitDBConfig(target querypb.Target, dbcfgs *dbconfigs.DBConfigs) error {
	tqsc.mu.Lock()
	defer tqsc.mu.Unlock()

	tqsc.CurrentTarget = target
	return nil
}
45257
func New(err error) config.Interface {
	if err == nil {
		panic("error cannot be nil")
	}
	return erroringInterface{err}
}