// New returns details about the testing environment
421768
func New() (*Execution, error) {
	env, err := environment.New()
	if err != nil {
		return nil, err
	}

	dockerBinary, err := exec.LookPath(DefaultClientBinary)
	if err != nil {
		return nil, err
	}

	return &Execution{
		Execution:    *env,
		dockerBinary: dockerBinary,
	}, nil
}
242946
func New(code string, message string) error {
	err := errors.New(message)
	return argoerr{code, message, err.(stackTracer)}
}
332093
func New(defaultRuntime string,
	runtimes map[string]RuntimeHandler,
	conmonPath string,
	conmonEnv []string,
	cgroupManager string,
	containerExitsDir string,
	containerAttachSocketDir string,
	logSizeMax int64,
	logToJournald bool,
	noPivot bool,
	ctrStopTimeout int64) (*Runtime, error) {

	defRuntime, ok := runtimes[defaultRuntime]
	if !ok {
		return nil, fmt.Errorf("no runtime configured for default_runtime=%q", defaultRuntime)
	}
	if defRuntime.RuntimePath == "" {
		return nil, fmt.Errorf("empty runtime path for default_runtime=%q", defaultRuntime)
	}

	return &Runtime{
		defaultRuntime:           defRuntime,
		runtimes:                 runtimes,
		conmonPath:               conmonPath,
		conmonEnv:                conmonEnv,
		cgroupManager:            cgroupManager,
		containerExitsDir:        containerExitsDir,
		containerAttachSocketDir: containerAttachSocketDir,
		logSizeMax:               logSizeMax,
		logToJournald:            logToJournald,
		noPivot:                  noPivot,
		ctrStopTimeout:           ctrStopTimeout,
		runtimeImplList:          make(map[string]RuntimeImpl),
	}, nil
}
351602
func New() *Environment {
	e := engine.New()
	var ey EngineYard = map[string]Engine{
		// Currently, the only template engine we support is the GoTpl one. But
		// we can easily add some here.
		GoTplEngine: e,
	}

	return &Environment{
		EngineYard: ey,
		Releases:   storage.Init(driver.NewMemory()),
	}
}
893574
func (factory *HueBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := HueBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
923638
func New(projectId int64, key string, environment string) *AirbrakeHandler {
	repoRoot, _, repoVersion := util.RepoInfo()
	context := &AirbrakeContext{
		OS:            runtime.GOOS + " " + runtime.GOARCH, //TODO syscall.Uname() when in linux
		Language:      "go " + runtime.Version(),
		Environment:   environment,
		RootDirectory: repoRoot,
		Version:       repoVersion,
	}

	env := map[string]string{}
	env["_"] = os.Args[0]
	env["GOVERSION"] = runtime.Version()
	env["GOMAXPROCS"] = fmt.Sprintf("%d", runtime.GOMAXPROCS(0))
	env["GOROOT"] = runtime.GOROOT()
	env["HOSTNAME"], _ = os.Hostname()

	aURL, _ := url.Parse(fmt.Sprintf("%s/api/v3/projects/%d/notices?key=%s", airbrakeURL, projectId, key))
	return &AirbrakeHandler{
		AirbrakeURL: aURL,
		projectId:   projectId,
		key:         key,
		Context:     context,
		Env:         env,
	}
}
639863
func New(code int, msgs Messages, args ...interface{}) error {
	return newErrorBox(nil, code, msgs, args...)
}
382175
func New(root string, options ...func(*LinuxFactory) error) (Factory, error) {
	if root != "" {
		if err := os.MkdirAll(root, 0700); err != nil {
			return nil, newGenericError(err, SystemError)
		}
	}
	l := &LinuxFactory{
		Root:      root,
		InitPath:  "/proc/self/exe",
		InitArgs:  []string{os.Args[0], "init"},
		Validator: validate.New(),
		CriuPath:  "criu",
	}
	Cgroupfs(l)
	for _, opt := range options {
		if opt == nil {
			continue
		}
		if err := opt(l); err != nil {
			return nil, err
		}
	}
	return l, nil
}
1002035
func New(config types.Config) (*Potassium, error) {
	return &Potassium{config.Scheduler.MaxShare, config.Scheduler.ShareBase}, nil
}
528535
func New(msg string, a ...interface{}) Error {
	msg = fmt.Sprintf(msg, a...)
	return Error{
		error: errors.New(msg),
	}
}
1239478
func (s *PluginTileBuilder) New(tileSpec tileregistry.TileSpec) (tileCloser tileregistry.TileCloser, err error) {
	var opsManager *opsmanager.OpsManager
	var settingsReader io.Reader
	opsManager, err = opsmanager.NewOpsManager(tileSpec.OpsManagerHost, tileSpec.AdminUser, tileSpec.AdminPass, tileSpec.AdminToken, tileSpec.OpsManagerUser, tileSpec.OpsManagerPass, tileSpec.OpsManagerPassphrase, tileSpec.ClientID, tileSpec.ClientSecret, tileSpec.ArchiveDirectory, tileSpec.CryptKey)

	if settingsReader, err = opsManager.GetInstallationSettings(); err == nil {
		var brPlugin BackupRestorer
		installationSettings := cfbackup.NewConfigurationParserFromReader(settingsReader)
		pcf := NewPivotalCF(installationSettings.InstallationSettings, tileSpec)
		lo.G.Debug("", s.Meta.Name, s.FilePath, pcf)
		brPlugin, client := s.call(tileSpec)
		brPlugin.Setup(pcf)
		tileCloser = struct {
			tileregistry.Tile
			tileregistry.Closer
		}{
			brPlugin,
			&ClientCloser{Client: client},
		}
	}
	lo.G.Debug("error from getinstallationsettings: ", err)
	return
}
48629
func New(sigtermTimeout time.Duration, env []string, command string, args ...string) (*Instance, chan error, error) {
	s := &Instance{
		command:        command,
		args:           args,
		env:            env,
		commandExit:    make(chan error, 1),
		sigtermTimeout: sigtermTimeout,
		signalChan:     make(chan os.Signal, 1),
	}
	go s.loop()
	return s, s.commandExit, nil
}
354109
func New(name, version string) *Kite {
	return NewWithConfig(name, version, config.New())
}
197556
func (factory *SimplepushBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := SimplepushBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
340129
func New(global interface{}, localPath string, flag interface{}) (_ interface{}, err error) {
	// Local config
	if localPath != "" {
		if _, err = toml.DecodeFile(localPath, global); err != nil {
			err = errors.Wrapf(err, "asticonfig: toml decoding %s failed", localPath)
			return
		}
	}

	// Merge configs
	if err = mergo.Merge(flag, global); err != nil {
		err = errors.Wrap(err, "asticonfig: merging configs failed")
		return
	}
	return flag, nil
}
256477
func New(config *Config) (*Service, error) {
	return NewWithProviders(
		config,
		&timetools.RealTime{},
		&random.CSPRNG{},
	)
}
51346
func New(cnf *config.Config, host, password, socketPath string, db int) iface.Backend {
	return &Backend{
		Backend:    common.NewBackend(cnf),
		host:       host,
		db:         db,
		password:   password,
		socketPath: socketPath,
	}
}