-
Notifications
You must be signed in to change notification settings - Fork 12
/
services.go
92 lines (76 loc) · 2.75 KB
/
services.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package misskey
import (
"github.com/yitsushi/go-misskey/core"
"github.com/yitsushi/go-misskey/services/admin"
"github.com/yitsushi/go-misskey/services/antennas"
"github.com/yitsushi/go-misskey/services/app"
"github.com/yitsushi/go-misskey/services/clips"
"github.com/yitsushi/go-misskey/services/drive"
"github.com/yitsushi/go-misskey/services/federation"
"github.com/yitsushi/go-misskey/services/following"
"github.com/yitsushi/go-misskey/services/hashtags"
"github.com/yitsushi/go-misskey/services/meta"
"github.com/yitsushi/go-misskey/services/notes"
"github.com/yitsushi/go-misskey/services/notifications"
"github.com/yitsushi/go-misskey/services/promo"
"github.com/yitsushi/go-misskey/services/users"
)
func (c *Client) requestHandler(request core.Request, response interface{}) error {
if err := request.Validate(); err != nil {
return err
}
return c.sendRequest(request, response)
}
// Meta is all the endpoints under Meta in the documentation.
// They don't have an API pth prefix.
func (c *Client) Meta() *meta.Service {
return meta.NewService(c.requestHandler)
}
// Antennas contains all endpoints under /antennas.
func (c *Client) Antennas() *antennas.Service {
return antennas.NewService(c.requestHandler)
}
// Notifications contains all endpoints under /notifications.
func (c *Client) Notifications() *notifications.Service {
return notifications.NewService(c.requestHandler)
}
// Hashtags contains all endpoints under /hashtags.
func (c *Client) Hashtags() *hashtags.Service {
return hashtags.NewService(c.requestHandler)
}
// Clips contains all endpoints under /clips.
func (c *Client) Clips() *clips.Service {
return clips.NewService(c.requestHandler)
}
// Drive contains all endpoints under /drive.
func (c *Client) Drive() *drive.Service {
return drive.NewService(c.requestHandler)
}
// Federation contains all endpoints under /federation.
func (c *Client) Federation() *federation.Service {
return federation.NewService(c.requestHandler)
}
// Notes contains all endpoints under /notes.
func (c *Client) Notes() *notes.Service {
return notes.NewService(c.requestHandler)
}
// Promo contains all endpoints under /promo.
func (c *Client) Promo() *promo.Service {
return promo.NewService(c.requestHandler)
}
// Admin contains all endpoints under /admin.
func (c *Client) Admin() *admin.Service {
return admin.NewService(c.requestHandler)
}
// Following contains all endpoints under /following.
func (c *Client) Following() *following.Service {
return following.NewService(c.requestHandler)
}
// Users contains all endpoints under /users.
func (c *Client) Users() *users.Service {
return users.NewService(c.requestHandler)
}
// App contains all endpoints under /app.
func (c *Client) App() *app.Service {
return app.NewService(c.requestHandler)
}