File: values.go

package info (click to toggle)
golang-github-go-openapi-runtime 0.0~git20160704.0.11e322e-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 896 kB
  • ctags: 802
  • sloc: sh: 16; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package runtime

// Values typically represent parameters on a http request.
type Values map[string][]string

// GetOK returns the values collection for the given key.
// When the key is present in the map it will return true for hasKey.
// When the value is not empty it will return true for hasValue.
func (v Values) GetOK(key string) (value []string, hasKey bool, hasValue bool) {
	value, hasKey = v[key]
	if !hasKey {
		return
	}
	if len(value) == 0 {
		return
	}
	hasValue = true
	return
}