-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubclass.go
33 lines (29 loc) · 958 Bytes
/
subclass.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
33
package go5e
type Subclass struct {
Id string `json:"_id"`
Index string `json:"index"`
Class NamedAPIResource `json:"class"`
Name string `json:"name"`
SubclassFlavour string `json:"subclass_flavor"`
Desc []string `json:"desc"`
Features []NamedAPIResource `json:"features"`
Url string `json:"url"`
}
func GetSubclass(index string) (Subclass, error) {
var ret Subclass
err := doRequestAndUnmarshal("subclasses/"+index, &ret)
if err != nil {
return ret, err
}
return ret, nil
}
func GetSubclassByUrl(url string) (Subclass, error) {
var ret Subclass
err := doRequestRawAndUnmarshal(url, ret)
return ret, err
}
func SearchSubclassByName(query string) (NamedAPIResourceList, error) {
var ret NamedAPIResourceList
err := doRequestAndUnmarshal("subclasses/?name="+query, &ret)
return ret, err
}