// execute sets up the tree traversal required to get the execution instructions for
// a route.
482957
func (r *Route) execute(ex *routeExecution, method, pattern string) {

	pathParts := pathPartsPool.Get().([]string)[0:0]
	pathParts = append(pathParts, "")
	start := 1
	for i := 1; i < len(pattern); i++ {
		if pattern[i] == '/' {
			pathParts = append(pathParts, pattern[start:i])
			i++
			start = i
		}
	}

	// get the trailing path param
	if pattern != "/" {
		pathParts = append(pathParts, pattern[start:])
	}

	// Fill the execution
	r.getExecution(method, pathParts, ex)

	// return path parts
	pathPartsPool.Put(pathParts)
}
889660
func (b BuildInfo) Execute(args []string) error {
	fmt.Printf("%s\n", b)
	return nil
}
684712
func (te *iptTemplateExecuter) execute() ([]*iptRule, error) {
	rules := make([]*iptRule, 0, len(te.templates))
	for _, t := range te.templates {
		w := new(bytes.Buffer)
		if err := t.Template.Execute(w, te.data); err != nil {
			return nil, err
		}
		af := seesaw.IPv6
		if te.data.ServiceVIP.To4() != nil {
			af = seesaw.IPv4
		}
		rule := &iptRule{
			af,
			t.action,
			w.String(),
		}
		rules = append(rules, rule)
	}
	return rules, nil
}
996613
func (t *Template) Execute(w io.Writer, data interface{}) error {
	return t.tmpl.Execute(w, data)
}
518332
func (entityApi *EntityApi) Execute(id string, operation string, body []byte, options map[string]string) ([]byte, error) {
	optionsCopy := map[string]string{}
	for k, v := range options {
		optionsCopy[k] = v
	}
	optionsCopy["operation"] = operation
	endpoint := entityApi.buildEndpoint()
	if id != "" {
		endpoint = endpoint + "/" + id
	}
	request := api.CcaRequest{
		Method:   api.POST,
		Body:     body,
		Endpoint: endpoint,
		Options:  optionsCopy,
	}
	response, err := entityApi.apiClient.Do(request)
	if err != nil {
		return nil, err
	} else if response.IsError() {
		return nil, api.CcaErrorResponse(*response)
	}

	return entityApi.taskService.PollResponse(response, DEFAULT_POLLING_INTERVAL)
}
501726
func (c *SchemaCheck) Execute(args []string) error {
	return c.doSchemaOp(schemaCheck, dosa.AdminClient.CanUpsertSchema, c.Args.Paths)
}
500537
func (a ActionFunc) Execute(ctx context.Context, state *Peco, e termbox.Event) {
	a(ctx, state, e)
}
794401
func (ex Extractors) execute(s *goquery.Selection) string {
	v := ""
	for _, e := range ex {
		v, s = e.fn(v, s)
	}
	return v
}
1147395
func (a SyncAction) Execute(
	ctx context.Context, c libkbfs.Config, fb data.FolderBranch,
	h *tlfhandle.Handle) (err error) {
	if fb == (data.FolderBranch{}) {
		panic("zero fb in SyncAction.Execute")
	}

	// Ensure the TLF is initialized by getting the root node first.
	_, _, err = c.KBFSOps().GetRootNode(ctx, h, data.MasterBranch)
	if err != nil {
		return err
	}

	switch a {
	case SyncEnable:
		_, err = c.KBFSOps().SetSyncConfig(
			ctx, fb.Tlf, keybase1.FolderSyncConfig{
				Mode: keybase1.FolderSyncMode_ENABLED,
			})

	case SyncDisable:
		_, err = c.KBFSOps().SetSyncConfig(
			ctx, fb.Tlf, keybase1.FolderSyncConfig{
				Mode: keybase1.FolderSyncMode_DISABLED,
			})

	default:
		return fmt.Errorf("Unknown action %s", a)
	}
	if err != nil {
		return err
	}
	// Re-trigger prefetches.
	_, _, err = c.KBFSOps().GetRootNode(ctx, h, fb.Branch)
	return err
}
129540
func (c *Client) Execute(command string) (response *Packet, err error) {
	return c.Send(Exec, command)
}
1210398
func Execute(db *sqlx.DB, sql string, params map[string]interface{}) (*Iterator, error) {
	var (
		err  error
		rows *sqlx.Rows
	)

	// Execute the query.
	if params != nil && len(params) > 0 {
		rows, err = db.NamedQuery(sql, params)
	} else {
		rows, err = db.Queryx(sql)
	}

	if err != nil {
		return nil, err
	}

	cols, err := rows.Columns()
	if err != nil {
		return nil, err
	}

	return &Iterator{
		Cols: cols,
		rows: rows,
	}, nil
}
1307916
func (cs CommandSet) Execute(command string, args []string) error {
	cmd, ok := cs[command]
	if !ok {
		return fmt.Errorf("unknown command: %s", command)
	}

	for _, arg := range args {
		if arg == "--help" || arg == "-h" || arg == "-help" {
			return cs.Execute("help", []string{command})
		}
	}

	err := cmd.Execute(args)
	if err != nil {
		return fmt.Errorf("could not execute %q: %s", command, err)
	}

	return nil
}
732899
func (ps *PulloutSubquery) Execute(vcursor VCursor, bindVars map[string]*querypb.BindVariable, wantfields bool) (*sqltypes.Result, error) {
	combinedVars, err := ps.execSubquery(vcursor, bindVars)
	if err != nil {
		return nil, err
	}
	return ps.Underlying.Execute(vcursor, combinedVars, wantfields)
}
1147314
func (tx *TX) Execute(stmt Executable, args ...interface{}) (sql.Result, error) {
	s, params, err := tx.compile(stmt)
	if err != nil {
		return nil, err
	}

	// Use any arguments given to Query() over compiled arguments
	if len(args) == 0 {
		args = params.args
	}
	return tx.Exec(s, args...)
}
1099989
func (i *Interpreter) Execute(
	expression string,
	ctx *el.Context) (interface{}, error) {
	expr, err := eval.ParseString(expression, "")
	if err != nil {
		return nil, fmt.Errorf("structor parse: <<%s>>: %v", ctx.LongName, err)
	}
	funcEval := func(intrpr, expr string) interface{} {
		res, err := ctx.EvalExpr(intrpr, expr, ctx)
		if err != nil {
			panic(err)
		}
		return res
	}
	args := eval.Args{
		"eval":      eval.MakeDataRegularInterface(funcEval),
		"ctx":       eval.MakeDataRegularInterface(ctx),
		"ctxStruct": eval.MakeTypeInterface(ctx.Struct),
	}
	if ctx.Extra != nil {
		args["ctxExtra"] = eval.MakeTypeInterface(ctx.Extra)
	}
	if ctx.Sub != nil {
		args["ctxSub"] = eval.MakeTypeInterface(ctx.Sub)
	}
	for k, v := range i.Args {
		args[k] = wrapFunc(v)
	}
	res, err := expr.EvalToInterface(args)
	if err != nil {
		return nil, fmt.Errorf("structor eval: <<%s>>: %v", ctx.LongName, err)
	}
	return res, nil
}
1330322
func (*localExecutor) Execute(command []string, in io.Reader, out, errOut io.Writer) error {
	klog.V(3).Infof("Local executor running command: %s", strings.Join(command, " "))
	cmd := exec.Command(command[0], command[1:]...)
	cmd.Stdout = out
	cmd.Stderr = errOut
	cmd.Stdin = in
	err := cmd.Run()
	if err != nil {
		klog.V(4).Infof("Error from local command execution: %v", err)
	}
	return err
}
1241093
func (o *Operation) Execute(args []string) error {
	if o.DumpData && len(o.Name) > 1 {
		return errors.New("only 1 operation at a time is supported for dumping data")
	}

	return createSwagger(o)
}