// Param returns the value of a url param base on the passed context
176194
func Param(c context.Context, key string) string {
	return C(c).Param(key)
}
839282
func StringParams(params map[string]string) RequestOption {
	return func(req *http.Request) (*http.Request, error) {
		q := req.URL.Query()
		for k, v := range params {
			q.Set(k, v)
		}
		req.URL.RawQuery = q.Encode()
		return req, nil
	}
}
61574
func durationParam(req *http.Request, param string) (time.Duration, bool, error) {
	q := req.URL.Query()
	t := strings.TrimSpace(q.Get(param))
	if t == "" {
		return 0, false, nil
	}
	dur, err := time.ParseDuration(t)
	if err != nil {
		return 0, false, err
	}
	return dur, true, nil
}
261282
func (b *HttpRequest) Param(key, value string) *HttpRequest {
	b.params[key] = value
	return b
}
3041
func Param(key, value string) p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		ctx.Request.URL.Path = replace(ctx.Request.URL.Path, key, value)
		h.Next(ctx)
	})
}
1020385
func (cmd *CLI) Params() values.Map {
	params := make(values.Map)
	for param, value := range cmd.paramValues {
		params[param.Name] = value
	}
	return params
}
679583
func (c *Ctx) Param(name string) string {

	for _, entry := range c.params {
		if entry.Key == name {
			return entry.Value
		}
	}

	return blank
}
760360
func (p parameters) add(key, value string) {
	url.Values(p).Add(key, value)
}
3593
func (cmd *CLI) Param(name string) values.Value {
	value, ok := cmd.Params()[name]
	if !ok {
		panic(fmt.Sprintf("param not defined %v", name))
	}
	return value
}
962080
func Params(ctx context.Context, key string) string {
	if params, ok := ctx.Value(kHrParamsKey).(httprouter.Params); !ok {
		return ""
	} else {
		return params.ByName(key)
	}
}
632071
func (f *Field) SetParam(key string, value interface{}) FieldInterface {
	f.params[key] = value
	return f
}
910762
func Params(req *http.Request) ParamCol {
	if value, ok := httpcontext.GetOk(req, paramsKey); ok {
		return ParamCol(value.(map[string]string))
	}
	return ParamCol{}
}
177296
func Params(req *http.Request) httprouter.Params {
	if value, ok := httpcontext.GetOk(req, paramsKey); ok {
		if params, ok := value.(httprouter.Params); ok {
			return params
		}
	}
	return httprouter.Params{}
}
943998
func Param(i interface{}) string {
	switch v := i.(type) {
	case string:
		return v
	case []string:
		return strings.Join(v, ",")
	case int:
		return strconv.Itoa(v)
	case []int:
		return slices.Ints(v).Join("", ",")
	case uint:
		return strconv.FormatUint(uint64(v), 10)
	case []uint:
		return slices.Uints(v).Join("", ",")
	case []byte:
		return string(v)
	}

	panic("Only support int, []int, uint, []uint, string, []string, []byte")
}
1071565
func (f *Field) DeleteParam(key string) FieldInterface {
	delete(f.params, key)
	return f
}
1219624
func Param(req *http.Request, paramName string) string {
	return req.URL.Query().Get(":" + paramName)
}
742156
func (ctx *Context) Param(key string, defaults ...string) string {
	return ctx.Params().MustString(key, defaults...)
}