// Echo implements the Oneway::Echo procedure.
354643
func (p *protoHandler) Echo(ctx context.Context, token *crossdockpb.Token) error {
	callBackAddr := yarpc.CallFromContext(ctx).Header(callBackAddrHeader)
	p.callHome(ctx, callBackAddr, []byte(token.Value), protobuf.Encoding)
	return nil
}
197993
func (self *Container) Exec(command string, c chan Exec) {
	go self.Run(command, c)
Loop:
	for {
		select {
		case s := <-c:
			if s.Output != "EOF" {
				fmt.Printf("%s", s.Output)
			} else {
				break Loop
			}
		}
	}
}
208418
func (br *BatchRead) String() string {
	return fmt.Sprintf("%s: %v", br.Key, br.BinNames)
}
711893
func (e *Echo) File(path, file string, m ...MiddlewareFunc) *Route {
	return e.file(path, file, e.GET, m...)
}
1056491
func (i *Index) Batch(operations []BatchOperation, opts ...interface{}) (res BatchRes, err error) {
	body := batchReq{Requests: operations}
	path := i.path("/batch")
	err = i.transport.Request(&res, http.MethodPost, path, body, call.Write, opts...)
	res.wait = i.WaitTask
	return
}
244677
func (e *Echo) Patch(path string, h interface{}, m ...interface{}) {
	e.add(PATCH, "", path, h, m...)
}
648664
func (m *MockBuildsServer) Batch(arg0 context.Context, arg1 *BatchRequest) (*BatchResponse, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Batch", arg0, arg1)
	ret0, _ := ret[0].(*BatchResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1215933
func main() {
	go func() { log.Fatal(echoServer()) }()

	err := clientMain()
	if err != nil {
		panic(err)
	}
}
71865
func EchoHandler() http.Handler {
	e := echo.New()

	e.POST("/login", func(ctx echo.Context) error {
		username := ctx.FormValue("username")
		password := ctx.FormValue("password")

		if username == "ford" && password == "betelgeuse7" {
			// create token
			token := jwt.New(jwt.SigningMethodHS256)

			// generate encoded token and send it as response
			t, err := token.SignedString([]byte("secret"))
			if err != nil {
				return err
			}
			return ctx.JSON(http.StatusOK, map[string]string{
				"token": t,
			})
		}

		return echo.ErrUnauthorized
	})

	r := e.Group("/restricted")

	r.Use(middleware.JWT([]byte("secret")))

	r.GET("/hello", func(ctx echo.Context) error {
		return ctx.String(http.StatusOK, "hello, world!")
	})

	return e
}
1160140
func (e *Echo) File(path, file string) {
	e.Get(path, func(c Context) error {
		return c.File(file)
	})
}
440187
func (e *Echo) Post(path string, h interface{}, m ...interface{}) {
	e.add(POST, "", path, h, m...)
}
325793
func (e *Echo) Get(path string, h interface{}, m ...interface{}) {
	e.add(GET, "", path, h, m...)
}
622604
func (c *client) echo(ctx context.Context) error {
	req, err := c.conn.NewRequest("GET", "_admin/echo")
	if err != nil {
		return WithStack(err)
	}
	applyContextSettings(ctx, req)
	resp, err := c.conn.Do(ctx, req)
	if err != nil {
		return WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return WithStack(err)
	}
	return nil
}
572671
func (ns *Namespace) EchoParam(a, key interface{}) interface{} {
	av, isNil := indirect(reflect.ValueOf(a))
	if isNil {
		return ""
	}

	var avv reflect.Value
	switch av.Kind() {
	case reflect.Array, reflect.Slice:
		index, ok := key.(int)
		if ok && av.Len() > index {
			avv = av.Index(index)
		}
	case reflect.Map:
		kv := reflect.ValueOf(key)
		if kv.Type().AssignableTo(av.Type().Key()) {
			avv = av.MapIndex(kv)
		}
	}

	avv, isNil = indirect(avv)

	if isNil {
		return ""
	}

	if avv.IsValid() {
		switch avv.Kind() {
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			return avv.Int()
		case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
			return avv.Uint()
		case reflect.Float32, reflect.Float64:
			return avv.Float()
		case reflect.String:
			return avv.String()
		}
	}

	return ""
}
476823
func (l *Linode) Batch(action string, params Parameters, result interface{}) {
	params.Set(apiAction, action)
	l.actions = append(l.actions, Action{
		parameters: params,
		result:     result,
	})
}
389942
func (v *VarCmd) Render(cmd string) (string, error) {
	var err error
	cmd = string(
		name.ReplaceAllFunc(
			[]byte(cmd),
			func(key []byte) []byte {
				cnt := 0
				for _, c := range key {
					if c != esc {
						break
					}
					cnt++
				}
				ks := strings.TrimLeft(string(key), string(esc))
				if cnt%2 != 0 {
					return []byte(strings.Repeat(string(esc), (cnt-1)/2) + ks)
				}
				val, errv := v.get(ks)
				if errv != nil {
					err = fmt.Errorf("No such variable: %s", ks)
					return nil
				}
				val = strings.Repeat(string(esc), cnt/2) + val
				return []byte(val)
			},
		),
	)
	if err != nil {
		return "", err
	}
	return cmd, nil
}
547619
func (e *Echo) Connect(path string, h interface{}, m ...interface{}) {
	e.add(CONNECT, "", path, h, m...)
}