// EchoEngine is echo router.
553332
func EchoEngine() *echo.Echo {
	e := echo.New()

	e.GET("/hello", echoHelloHandler())
	e.GET("/text", echoTextHandler())
	e.GET("/query", echoQueryHandler())

	e.POST("/form", echoPostFormHandler())
	e.POST("/json", echoJSONHandler())
	e.PUT("/update", echoPutHandler())
	e.DELETE("/delete", echoDeleteHandler())

	e.PATCH("/patch", echoHelloHandler())
	e.OPTIONS("/options", echoHelloHandler())
	e.HEAD("/head", echoHelloHandler())

	return e
}
736989
func (f *FooYARPCServer) EchoIn(request *examplepb.EchoInRequest, server examplepb.FooServiceEchoInYARPCServer) error {
	if request == nil {
		return errRequestNil
	}
	if request.Message == "" {
		return errRequestMessageNil
	}
	if request.NumResponses == 0 {
		return errRequestNumResponsesNil
	}
	call := yarpc.CallFromContext(server.Context())
	for k, v := range f.expectedHeaders.Items() {
		if call.Header(k) != v {
			return yarpcerrors.InvalidArgumentErrorf("did not receive proper headers, missing %q:%q", k, v)
		}
	}
	for i := 0; i < int(request.NumResponses); i++ {
		if err := server.Send(&examplepb.EchoInResponse{Message: request.Message}); err != nil {
			return err
		}
	}
	return nil
}
1049529
func NewEngine(backend Backend) *Engine {
	return &Engine{
		Backend:        backend,
		ConnectTimeout: 10 * time.Second,
	}
}
517834
func Django(directory, extension string) *DjangoEngine {
	s := &DjangoEngine{
		directory:     directory,
		extension:     extension,
		globals:       make(map[string]interface{}, 0),
		filters:       make(map[string]FilterFunction, 0),
		templateCache: make(map[string]*pongo2.Template, 0),
	}

	return s
}
548888
func (e *Echo) Routes() []*Route {
	routes := make([]*Route, 0, len(e.router.routes))
	for _, v := range e.router.routes {
		routes = append(routes, v)
	}
	return routes
}
326897
func EchoJSON(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error) {
	call := yarpc.CallFromContext(ctx)
	for _, k := range call.HeaderNames() {
		if err := call.WriteResponseHeader(k, call.Header(k)); err != nil {
			return nil, err
		}
	}
	return body, nil
}
207408
func (this *Server) Engine(ext string, fn Renderer) {
	this.engines[ext] = fn
}
953243
func (s *CreateServerInput) SetEngine(v string) *CreateServerInput {
	s.Engine = &v
	return s
}
504786
func (s *RelationalDatabase) SetEngine(v string) *RelationalDatabase {
	s.Engine = &v
	return s
}
1146669
func (s *CacheEngineVersion) SetEngine(v string) *CacheEngineVersion {
	s.Engine = &v
	return s
}
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)
}
847665
func (c *Client) Echo(message string) (string, error) {
	v, err := c.execWithKey(true, "ECHO", message)
	if err != nil {
		return "", err
	}
	return iface2str(v)
}
989752
func NewEngine(ts srvtopo.Server, se *schema.Engine) *Engine {
	vse := &Engine{
		streamers:    make(map[int]*vstreamer),
		rowStreamers: make(map[int]*rowStreamer),
		kschema:      &vindexes.KeyspaceSchema{},
		ts:           ts,
		se:           se,
	}
	once.Do(func() {
		vschemaErrors = stats.NewCounter("VSchemaErrors", "Count of VSchema errors")
		vschemaUpdates = stats.NewCounter("VSchemaUpdates", "Count of VSchema updates. Does not include errors")
		http.Handle("/debug/tablet_vschema", vse)
	})
	return vse
}
956365
func (s *Backup) SetEngine(v string) *Backup {
	s.Engine = &v
	return s
}
692530
func (o *onewayHandler) EchoRaw(ctx context.Context, body []byte) error {
	callBackAddr := yarpc.CallFromContext(ctx).Header(callBackAddrHeader)
	o.callHome(ctx, callBackAddr, body, raw.Encoding)
	return nil
}
286532
func NewEchoServer(addr string) *EchoServer {
	return &EchoServer{
		addr: addr,
		server: goetty.NewServer(addr,
			goetty.WithServerDecoder(goetty.NewIntLengthFieldBasedDecoder(&StringDecoder{})),
			goetty.WithServerEncoder(&StringEncoder{})),
	}
}
1132070
func NewEngine(driverName string, dataSourceName string) (*Engine, error) {
	regDrvsNDialects()
	driver := core.QueryDriver(driverName)
	if driver == nil {
		return nil, fmt.Errorf("Unsupported driver name: %v", driverName)
	}

	uri, err := driver.Parse(driverName, dataSourceName)
	if err != nil {
		return nil, err
	}

	dialect := core.QueryDialect(uri.DbType)
	if dialect == nil {
		return nil, fmt.Errorf("Unsupported dialect type: %v", uri.DbType)
	}

	db, err := core.Open(driverName, dataSourceName)
	if err != nil {
		return nil, err
	}

	err = dialect.Init(db, uri, driverName, dataSourceName)
	if err != nil {
		return nil, err
	}

	engine := &Engine{
		db:            db,
		dialect:       dialect,
		Tables:        make(map[reflect.Type]*core.Table),
		mutex:         &sync.RWMutex{},
		TagIdentifier: "xorm",
		TZLocation:    time.Local,
	}

	logger := NewSimpleLogger(os.Stdout)
	logger.SetLevel(core.LOG_INFO)
	engine.SetLogger(logger)
	engine.SetMapper(core.NewCacheMapper(new(core.SnakeMapper)))

	engine.Init()
	runtime.SetFinalizer(engine, close)

	return engine, nil
}