GetQueryParams - encodes the values in url
()
| 123 | |
| 124 | // GetQueryParams - encodes the values in url |
| 125 | func (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 |
| 146 | var ErrInvalidConfigVersion error = fmt.Errorf("invalid config version") |
no test coverage detected