// QueryParams returns a map containing url query params.
337689
func (f FindOptions) QueryParams() map[string][]string {
	qp := map[string][]string{
		"offset":     {strconv.Itoa(f.Offset)},
		"descending": {strconv.FormatBool(f.Descending)},
	}

	if f.Limit > 0 {
		qp["limit"] = []string{strconv.Itoa(f.Limit)}
	}

	if f.SortBy != "" {
		qp["sortBy"] = []string{f.SortBy}
	}

	return qp
}
108048
func MatchQueryParams(req *http.Request, ereq *Request) (bool, error) {
	for key, value := range ereq.URLStruct.Query() {
		var err error
		var match bool

		for _, field := range req.URL.Query()[key] {
			match, err = regexp.MatchString(value[0], field)
			if err != nil {
				return false, err
			}
			if match {
				break
			}
		}

		if !match {
			return false, nil
		}
	}
	return true, nil
}
178700
func (c *Connection) PaginateFromParams(params PaginationParams) *Query {
	return Q(c).PaginateFromParams(params)
}
295287
func (f DashboardFilter) QueryParams() map[string][]string {
	qp := url.Values{}
	for _, id := range f.IDs {
		if id != nil {
			qp.Add("id", id.String())
		}
	}

	if f.OrganizationID != nil {
		qp.Add("orgID", f.OrganizationID.String())
	}

	if f.Organization != nil {
		qp.Add("org", *f.Organization)
	}

	return qp
}
829767
func Param(k string, v string) Filter {
	return func(r *http.Request) {
		q := r.URL.Query()
		q.Set(k, v)
		r.URL.RawQuery = q.Encode()
	}
}
389051
func (r *Request) QueryValues() url.Values {
	if r.Values == nil {
		if r.Request != nil {
			r.Values = r.Request.URL.Query()
		} else {
			r.Values = url.Values{}
		}
	}
	return r.Values
}
1118335
func mapValues(params map[string]string) url.Values {
	values := url.Values{}
	for key, val := range params {
		values.Add(key, val)
	}
	return values
}
605627
func (o BoundOptions) getParameters() (params map[string]string, err error) {
	return map[string]string{
		"bounds": fmt.Sprintf("%v,%v|%v,%v",
			o.SwLatitude,
			o.SwLongitude,
			o.NeLatitude,
			o.NeLongitude,
		),
	}, nil
}
99672
func (o *QueryOptions) URLQueryParameters() URLQueryParameters {
	var queryParams URLQueryParameters
	if o.IsSTU3Sort {
		keys := make([]string, len(o.Sort))
		for i := range o.Sort {
			if o.Sort[i].Descending {
				keys[i] = fmt.Sprintf("-%s", o.Sort[i].Parameter.Name)
			} else {
				keys[i] = o.Sort[i].Parameter.Name
			}
		}
		queryParams.Add(SortParam, strings.Join(keys, ","))
	} else {
		for _, sort := range o.Sort {
			sortParamKey := SortParam
			if sort.Descending {
				sortParamKey += ":desc"
			}
			queryParams.Add(sortParamKey, sort.Parameter.Name)
		}
	}
	queryParams.Set(OffsetParam, strconv.Itoa(o.Offset))
	queryParams.Set(CountParam, strconv.Itoa(o.Count))
	for _, incl := range o.Include {
		queryParams.Add(IncludeParam, fmt.Sprintf("%s:%s", incl.Resource, incl.Parameter.Name))
	}
	for _, incl := range o.RevInclude {
		queryParams.Add(RevIncludeParam, fmt.Sprintf("%s:%s", incl.Resource, incl.Parameter.Name))
	}
	return queryParams
}
767363
func (s *Serf) DefaultQueryParams() *QueryParam {
	return &QueryParam{
		FilterNodes: nil,
		FilterTags:  nil,
		RequestAck:  false,
		Timeout:     s.DefaultQueryTimeout(),
	}
}
1143407
func DecodeSEOQueryParams(r *http.Request, v interface{}) (err error) {

	if rvi := r.Context().Value(defaultContextIdentifier); rvi != nil {

		rv := rvi.(*requestVars)

		values := make(url.Values, len(rv.params))

		for _, p := range rv.params {
			values.Add(p.key, p.value)
		}

		err = DefaultDecoder.Decode(v, values)
	}

	return
}
1215623
func GetReqQueryParam(req *http.Request, headerName string) string {
	return strings.TrimSpace(req.URL.Query().Get(headerName))
}
591822
func (c *Client) Params(params map[string]string) *Client {
	c.Use(url.Params(params))
	return c
}
604241
func buildURLParams(userURL string, params map[string]string) (string, error) {
	parsedURL, err := url.Parse(userURL)

	if err != nil {
		return "", err
	}

	parsedQuery, err := url.ParseQuery(parsedURL.RawQuery)

	if err != nil {
		return "", nil
	}

	for key, value := range params {
		parsedQuery.Set(key, value)
	}

	return addQueryParams(parsedURL, parsedQuery), nil
}
271723
func (f BucketFilter) QueryParams() map[string][]string {
	qp := map[string][]string{}
	if f.ID != nil {
		qp["id"] = []string{f.ID.String()}
	}

	if f.Name != nil {
		qp["name"] = []string{*f.Name}
	}

	if f.OrganizationID != nil {
		qp["orgID"] = []string{f.OrganizationID.String()}
	}

	if f.Organization != nil {
		qp["org"] = []string{*f.Organization}
	}

	return qp
}
603085
func (ctx *Context) GETParams() map[string][]string {
	res := make(map[string][]string)
	ctx.Request.URI().QueryArgs().VisitAll(func(key, value []byte) {
		res[string(key)] = append(res[string(key)], string(value))
	})
	return res
}
419486
func ExtractQueryParams(queryParams map[string]interface{}) (query string, args []interface{}) {
	for key, value := range queryParams {
		if query == "" {
			query += key
		} else {
			query += " AND " + key
		}
		args = append(args, value)
	}
	return
}