// New returns a new device manager
164709
func New(c *Config) *manager {
	ctx, cancel := context.WithCancel(context.Background())
	return &manager{
		logger:           c.Logger.Named("device_mgr"),
		state:            c.State,
		ctx:              ctx,
		cancel:           cancel,
		loader:           c.Loader,
		pluginConfig:     c.PluginConfig,
		updater:          c.Updater,
		instances:        make(map[loader.PluginID]*instanceManager),
		reattachConfigs:  make(map[loader.PluginID]*pstructs.ReattachConfig),
		fingerprintResCh: make(chan struct{}, 1),
	}
}
59150
func New(c Config) (Manager, error) {
	switch c.Type {
	case "", "docker":
		return &Docker{Socket: c.Socket, Runner: c.Runner}, nil
	case "crio", "cri-o":
		return &CRIO{Socket: c.Socket, Runner: c.Runner}, nil
	case "containerd":
		return &Containerd{Socket: c.Socket, Runner: c.Runner}, nil
	default:
		return nil, fmt.Errorf("unknown runtime type: %q", c.Type)
	}
}
1358873
func New(framework *choria.Framework, logger *logrus.Entry) *Manager {
	return &Manager{
		fw:  framework,
		cfg: framework.Config,
		log: logger.WithFields(logrus.Fields{"subsystem": "discovery"}),
	}
}
689357
func (rl *RevelLogger) New(ctx ...interface{}) MultiLogger {
	old := &RevelLogger{Logger: rl.Logger.New(ctx...)}
	return old
}
278165
func New(lDs, gDs interface{}, dfn DriverNotifyFunc, ifn IPAMNotifyFunc, pg plugingetter.PluginGetter) (*DrvRegistry, error) {
	r := &DrvRegistry{
		drivers:      make(driverTable),
		ipamDrivers:  make(ipamTable),
		dfn:          dfn,
		ifn:          ifn,
		pluginGetter: pg,
	}

	return r, nil
}
550812
func (api *SimpleMonitorAPI) New(target string) *sacloud.SimpleMonitor {
	return sacloud.CreateNewSimpleMonitor(target)
}
238569
func New() storage.Store {
	return &store{
		data:     map[string]interface{}{},
		triggers: map[*handle]storage.TriggerConfig{},
		policies: map[string][]byte{},
		indices:  newIndices(),
	}
}
1333310
func New(logger *logrus.Logger) goa.LogAdapter {
	return FromEntry(logrus.NewEntry(logger))
}
611697
func (m *residentManager) new() *Resident {
	id := m.residentCount.next()

	r := &Resident{
		id:             id,
		deregister:     func() { m.deregister(id) },
		nextResourceId: func() uint64 { return m.resourceCount.next() },
		workers:        make(map[uint64]worker.Worker),
	}

	m.mu.Lock()
	m.residents[r.id] = r
	m.mu.Unlock()

	return r
}
361653
func New(mode string, bus embd.I2CBus) *BH1750FVI {
	switch mode {
	case High:
		return &BH1750FVI{Bus: bus, i2cAddr: sensorI2cAddr, operationCode: highResOpCode, Poll: pollDelay}
	case High2:
		return &BH1750FVI{Bus: bus, i2cAddr: sensorI2cAddr, operationCode: highResMode2OpCode, Poll: pollDelay}
	default:
		return &BH1750FVI{Bus: bus, i2cAddr: sensorI2cAddr, operationCode: highResOpCode, Poll: pollDelay}
	}
}
206319
func New(exec utilexec.Interface, dbus utildbus.Interface, protocol Protocol) Interface {
	return newInternal(exec, dbus, protocol, "")
}
997054
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
	return &Client{transport: transport, formats: formats}
}
971413
func New(m *GinJWTMiddleware) (*GinJWTMiddleware, error) {
	if err := m.MiddlewareInit(); err != nil {
		return nil, err
	}

	return m, nil
}
672372
func New(bus embd.I2CBus) *BMP180 {
	return &BMP180{Bus: bus, Poll: pollDelay}
}
295741
func (s *OpsManagerBuilder) New(tileSpec tileregistry.TileSpec) (opsManagerTileCloser tileregistry.TileCloser, err error) {
	var opsManager *OpsManager
	opsManager, err = NewOpsManager(
		tileSpec.OpsManagerHost,
		tileSpec.AdminUser,
		tileSpec.AdminPass,
		tileSpec.AdminToken,
		tileSpec.OpsManagerUser,
		tileSpec.OpsManagerPass,
		tileSpec.OpsManagerPassphrase,
		tileSpec.ClientID,
		tileSpec.ClientSecret,
		tileSpec.ArchiveDirectory,
		tileSpec.CryptKey)
	opsManager.ClearBoshManifest = tileSpec.ClearBoshManifest

	if installationSettings, err := opsManager.GetInstallationSettings(); err == nil {
		config := cfbackup.NewConfigurationParserFromReader(installationSettings)

		if iaas, hasKey := config.GetIaaS(); hasKey {
			lo.G.Debug("we found a iaas info block")
			opsManager.SetSSHPrivateKey(iaas.SSHPrivateKey)

		} else {
			lo.G.Debug("No IaaS PEM key found. Defaulting to using ssh username and password credentials")
		}
	}
	opsManagerTileCloser = struct {
		tileregistry.Tile
		tileregistry.Closer
	}{
		opsManager,
		new(tileregistry.DoNothingCloser),
	}
	return
}
1264250
func New(driver Driver, migrations []Migration, infoChan chan MigrationInfo) Darwin {
	return Darwin{
		driver:     driver,
		migrations: migrations,
		infoChan:   infoChan,
	}
}
665763
func New(cfg interface{}, gadgets ...Gadgeter) *App {
	config := GetConfig(cfg)
	return &App{
		gadgets: config.CreateGadgets(gadgets...),
	}
}