-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproficiency.go
32 lines (28 loc) · 870 Bytes
/
proficiency.go
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
package go5e
type Proficiency struct {
Id string `json:"_id"`
Index string `json:"index"`
Type string `json:"type"`
Name string `json:"name"`
Classes []NamedAPIResource `json:"classes"`
Races []NamedAPIResource `json:"races"`
Url string `json:"url"`
}
func GetProficiency(index string) (Proficiency, error) {
var ret Proficiency
err := doRequestAndUnmarshal("proficiencies/"+index, &ret)
if err != nil {
return ret, err
}
return ret, nil
}
func GetProficiencyByUrl(url string) (Proficiency, error) {
var ret Proficiency
err := doRequestRawAndUnmarshal(url, ret)
return ret, err
}
func SearchProficiencyByName(query string) (NamedAPIResourceList, error) {
var ret NamedAPIResourceList
err := doRequestAndUnmarshal("proficiencies/?name="+query, &ret)
return ret, err
}