forked from italia/publiccode-parser-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_scope.go
More file actions
39 lines (35 loc) · 779 Bytes
/
Copy pathcheck_scope.go
File metadata and controls
39 lines (35 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package publiccode
import funk "github.com/thoas/go-funk"
// checkScope tells whether the supplied value is a valid scope or not and returns it.
func (p *Parser) checkScope(key, scope string) (string, error) {
if funk.Contains(supportedScopes, scope) {
return scope, nil
}
return "", newErrorInvalidValue(key, "unknown scope: %s", scope)
}
var supportedScopes = []string{
"agriculture",
"culture",
"defence",
"education",
"emergency-services",
"employment",
"energy",
"environment",
"finance-and-economic-development",
"foreign-affairs",
"government",
"healthcare",
"infrastructures",
"justice",
"local-authorities",
"manufacturing",
"research",
"science-and-technology",
"security",
"society",
"sport",
"tourism",
"transportation",
"welfare",
}