MCPcopy
hub / github.com/grafana/tempo / addParam

Method addParam

pkg/api/query_builder.go:25–38  ·  view source on GitHub ↗

addParam adds a new key/val pair to the query like https://cs.opensource.google/go/go/+/refs/tags/go1.22.5:src/net/url/url.go;l=972

(key, value string)

Source from the content-addressed store, hash-verified

23// addParam adds a new key/val pair to the query
24// like https://cs.opensource.google/go/go/+/refs/tags/go1.22.5:src/net/url/url.go;l=972
25func (qb *queryBuilder) addParam(key, value string) {
26 if qb.builder.Len() > 0 {
27 qb.builder.WriteByte('&')
28 }
29
30 keyStr := url.QueryEscape(key)
31 valueStr := url.QueryEscape(value)
32
33 qb.builder.Grow(len(keyStr) + len(valueStr) + 1)
34
35 qb.builder.WriteString(keyStr)
36 qb.builder.WriteByte('=')
37 qb.builder.WriteString(valueStr)
38}
39
40func (qb *queryBuilder) query() string {
41 return qb.builder.String()

Callers 10

BuildQueryInstantRequestFunction · 0.80
BuildQueryRangeRequestFunction · 0.80
BuildQueryRequestFunction · 0.80
BuildSearchRequestFunction · 0.80
BuildSearchBlockRequestFunction · 0.80
TestQueryBuilderFunction · 0.80
BuildSearchTagsRequestFunction · 0.80

Calls 1

LenMethod · 0.65

Tested by 1

TestQueryBuilderFunction · 0.64