forked from michaelklishin/rabbit-hole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
federation_links.go
41 lines (31 loc) · 896 Bytes
/
federation_links.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
34
35
36
37
38
39
40
41
package rabbithole
import "net/url"
type FederationLinkMap = []map[string]interface{}
//
// GET /api/federation-links
//
// ListFederationLinks returns a list of all federation links.
func (c *Client) ListFederationLinks() (links FederationLinkMap, err error) {
req, err := newGETRequest(c, "federation-links")
if err != nil {
return links, err
}
if err = executeAndParseRequest(c, req, &links); err != nil {
return links, err
}
return links, nil
}
//
// GET /api/federation-links/{vhost}
//
// ListFederationLinksIn returns a list of federation links in a vhost.
func (c *Client) ListFederationLinksIn(vhost string) (links FederationLinkMap, err error) {
req, err := newGETRequest(c, "federation-links/"+url.PathEscape(vhost))
if err != nil {
return links, err
}
if err = executeAndParseRequest(c, req, &links); err != nil {
return links, err
}
return links, nil
}