blob: 11f5732af4e33a457bdee917d8899e0c24bdb24d [file] [log] [blame]
Serge Bazanskicc25bdf2018-10-25 14:02:58 +02001package runtime
2
3// Values typically represent parameters on a http request.
4type Values map[string][]string
5
6// GetOK returns the values collection for the given key.
7// When the key is present in the map it will return true for hasKey.
8// When the value is not empty it will return true for hasValue.
9func (v Values) GetOK(key string) (value []string, hasKey bool, hasValue bool) {
10 value, hasKey = v[key]
11 if !hasKey {
12 return
13 }
14 if len(value) == 0 {
15 return
16 }
17 hasValue = true
18 return
19}