MCPcopy
hub / github.com/hasura/graphql-engine / GetQueryParams

Method GetQueryParams

cli/cli.go:125–143  ·  view source on GitHub ↗

GetQueryParams - encodes the values in url

()

Source from the content-addressed store, hash-verified

123
124// GetQueryParams - encodes the values in url
125func (s ServerAPIPaths) GetQueryParams() url.Values {
126 vals := url.Values{}
127 t := reflect.TypeOf(s)
128 for i := 0; i < t.NumField(); i++ {
129 field := t.Field(i)
130 tag := field.Tag.Get("yaml")
131 splitTag := strings.Split(tag, ",")
132 if len(splitTag) == 0 {
133 continue
134 }
135 name := splitTag[0]
136 if name == "-" {
137 continue
138 }
139 v := reflect.ValueOf(s).Field(i)
140 vals.Add(name, v.String())
141 }
142 return vals
143}
144
145// ErrInvalidConfigVersion - if the config version is not valid
146var ErrInvalidConfigVersion error = fmt.Errorf("invalid config version")

Callers 1

GetDataPathFunction · 0.80

Calls 2

GetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected