Debian Codegraph @

api/link.go

raw symbols SCIP
1 package api
2
3 type Link struct {
4 Rel string `json:"rel,omitempty"`
5 Href string `json:"href,omitempty"`
6 ID string `json:"id,omitempty"`
7 Name string `json:"name,omitempty"`
8 Verbs []string `json:"verbs,omitempty"`
9 }
10
11 type Links []Link
12
13 func (l Links) GetID(rel string) (bool, string) {
14 if ok, v := l.GetLink(rel); ok {
15 return true, (*v).ID
16 }
17 return false, ""
18 }
19
20 func (l Links) GetLink(rel string) (bool, *Link) {
21 for _, v := range l {
22 if v.Rel == rel {
23 return true, &v
24 }
25 }
26 return false, nil
27 }
28
29 type Customfields struct {
30 ID string `json:"id,omitempty"`
31 Name string `json:"name,omitempty"`
32 Value string `json:"value,omitempty"`
33 Displayvalue string `json:"displayValue,omitempty"`
34 }