// NewEngine returns a new Engine
344979
func NewEngine(s session.Session, db Database, e *crypto.Engine,
	client *registry.Client, guard *secure.Guard) *Engine {
	engine := &Engine{
		session: s,
		db:      db,
		crypto:  e,
		client:  client,
		guard:   guard,
	}
	engine.Worklog = newWorklog(engine)
	engine.Machine = Machine{engine: engine}
	engine.Session = Session{engine: engine}
	return engine
}
1002924
func (s *DescribeBrokerResponse) SetEngineType(v string) *DescribeBrokerResponse {
	s.EngineType = &v
	return s
}
479819
func (s *PendingModifiedValues) SetEngineVersion(v string) *PendingModifiedValues {
	s.EngineVersion = &v
	return s
}
648083
func New(cfg ...Config) *Engine {
	c := DefaultConfig()
	if len(cfg) > 0 {
		c = cfg[0]
	}

	return &Engine{Config: c, templateCache: make(map[string][]byte)}
}
1109522
func (s *GlobalCluster) SetEngine(v string) *GlobalCluster {
	s.Engine = &v
	return s
}
1012291
func NewVerificationEngine(context string) (VerificationEngine, error) {

	engine := VerificationEngine{}

	if context == "" {
		return engine, errors.New("Context cannot be empty when initializing the Verification Engine")
	}

	// try to load the public key and if it succeed, then return both the keys
	publicFile := fmt.Sprintf(publicKeySuffixFormat, sanitizeIdentifier(context))
	// if the key exists
	if keyFileExists(publicFile) {
		// try to read it
		public, err := readKey(publicFile, keysFolderPrefixFormat)
		if err != nil {
			// in case of error return it
			return engine, err
		}

		// if we reached here, it means that both the public key
		// existed and was loaded successfull
		engine.publicKey = public
	}

	return engine, nil

}
526676
func (c *baseClient) ActivateEngine(ctx context.Context, opts clitypes.EngineInitOptions, out clitypes.OutStream,
	authConfig *types.AuthConfig) error {

	// If the user didn't specify an image, determine the correct enterprise image to use
	if opts.EngineImage == "" {
		localMetadata, err := versions.GetCurrentRuntimeMetadata(opts.RuntimeMetadataDir)
		if err != nil {
			return errors.Wrap(err, "unable to determine the installed engine version. Specify which engine image to update with --engine-image")
		}

		engineImage := localMetadata.EngineImage
		if engineImage == clitypes.EnterpriseEngineImage || engineImage == clitypes.CommunityEngineImage {
			opts.EngineImage = clitypes.EnterpriseEngineImage
		} else {
			// Chop off the standard prefix and retain any trailing OS specific image details
			// e.g., engine-community-dm -> engine-enterprise-dm
			engineImage = strings.TrimPrefix(engineImage, clitypes.EnterpriseEngineImage)
			engineImage = strings.TrimPrefix(engineImage, clitypes.CommunityEngineImage)
			opts.EngineImage = clitypes.EnterpriseEngineImage + engineImage
		}
	}

	ctx = namespaces.WithNamespace(ctx, engineNamespace)
	return c.DoUpdate(ctx, opts, out, authConfig)
}
1132178
func (s *CreateCacheClusterInput) SetEngine(v string) *CreateCacheClusterInput {
	s.Engine = &v
	return s
}
939522
func NewEngine(path string, c Config, options ...Option) *Engine {
	e := &Engine{
		config:              c,
		path:                path,
		defaultMetricLabels: prometheus.Labels{},
		logger:              zap.NewNop(),
	}

	// Initialize series file.
	e.sfile = tsdb.NewSeriesFile(c.GetSeriesFilePath(path))

	// Initialise index.
	e.index = tsi1.NewIndex(e.sfile, c.Index,
		tsi1.WithPath(c.GetIndexPath(path)))

	// Initialize WAL
	var wal tsm1.Log = new(tsm1.NopWAL)
	if c.WAL.Enabled {
		e.wal = tsm1.NewWAL(c.GetWALPath(path))
		e.wal.WithFsyncDelay(time.Duration(c.WAL.FsyncDelay))
		e.wal.EnableTraceLogging(c.TraceLoggingEnabled)
		wal = e.wal
	}

	// Initialise Engine
	e.engine = tsm1.NewEngine(c.GetEnginePath(path), e.index, c.Engine,
		tsm1.WithWAL(wal),
		tsm1.WithTraceLogging(c.TraceLoggingEnabled))

	// Apply options.
	for _, option := range options {
		option(e)
	}
	// Set default metrics labels.
	e.engine.SetDefaultMetricLabels(e.defaultMetricLabels)
	e.sfile.SetDefaultMetricLabels(e.defaultMetricLabels)
	e.index.SetDefaultMetricLabels(e.defaultMetricLabels)

	return e
}
906142
func (s *DBInstanceAutomatedBackup) SetEngine(v string) *DBInstanceAutomatedBackup {
	s.Engine = &v
	return s
}
162311
func GinEngine() *gin.Engine {
	gin.SetMode(gin.TestMode)
	r := gin.New()

	r.GET("/", ginHelloHandler)
	r.GET("/user/:name", ginUserHandler)

	return r
}
29515
func (loader *TemplateLoader) initializeEngines(runtimeLoader *templateRuntime, templateEngineNameList string) (err *Error) {
	// Walk through the template loader's paths and build up a template set.
	if templateEngineNameList == "" {
		templateEngineNameList = GO_TEMPLATE

	}
	runtimeLoader.templatesAndEngineList = []TemplateEngine{}
	for _, engine := range strings.Split(templateEngineNameList, ",") {
		engine := strings.TrimSpace(strings.ToLower(engine))

		if templateLoader, err := loader.CreateTemplateEngine(engine); err != nil {
			runtimeLoader.compileError = &Error{
				Title:       "Panic (Template Loader)",
				Description: err.Error(),
			}
			return runtimeLoader.compileError
		} else {
			// Always assign a default engine, switch it if it is specified in the config
			runtimeLoader.templatesAndEngineList = append(runtimeLoader.templatesAndEngineList, templateLoader)
		}
	}
	return
}
1094512
func NewConn(c net.Conn) net.Conn {
	return NewConnWith(stats.DefaultEngine, c)
}
953243
func (s *CreateServerInput) SetEngine(v string) *CreateServerInput {
	s.Engine = &v
	return s
}
210371
func (s *RestoreDBInstanceFromDBSnapshotInput) SetEngine(v string) *RestoreDBInstanceFromDBSnapshotInput {
	s.Engine = &v
	return s
}
1365710
func NewEngine(tsv TabletService, se *schema.Engine, config tabletenv.TabletConfig) *Engine {
	return &Engine{
		tsv: tsv,
		se:  se,
		conns: connpool.New(
			config.PoolNamePrefix+"MessagerPool",
			config.MessagePoolSize,
			time.Duration(config.IdleTimeout*1e9),
			tsv,
		),
		postponeSema: sync2.NewSemaphore(config.MessagePostponeCap, 0),
		managers:     make(map[string]*messageManager),
	}
}
1285462
func (s *RelationalDatabaseBlueprint) SetEngine(v string) *RelationalDatabaseBlueprint {
	s.Engine = &v
	return s
}