-
Notifications
You must be signed in to change notification settings - Fork 7
/
api.go
76 lines (61 loc) · 1.36 KB
/
api.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
package ButterCMS
type PagingMeta struct {
Count int `json:"count"`
NextPage int `json:"next_page"`
PreviousPage int `json:"previous_page"`
}
// Posts
type PostsAPIResponse struct {
MetaData PagingMeta `json:"meta"`
PostList []Post `json:"data"`
}
type PostMeta struct {
NextPost Post `json:"next_post"`
PreviousPost Post `json:"previous_post"`
}
type PostAPIResponse struct {
MetaData PostMeta `json:"meta"`
Post Post `json:"data"`
}
// Pages
type PagesMeta struct {
Count int `json:"count"`
NextPage int `json:"next_page"`
PreviousPage int `json:"previous_page"`
}
type PagesAPIResponse struct {
MetaData PagingMeta `json:"meta"`
PageList []Page `json:"data"`
}
type PageAPIResponse struct {
Page Page `json:"data"`
}
// Categories
type CategoriesAPIResponse struct {
CategoryList []Category `json:"data"`
}
type CategoryAPIResponse struct {
Category Category `json:"data"`
}
// Tags
type TagsAPIResponse struct {
TagList []Tag `json:"data"`
}
type TagAPIResponse struct {
Tag Tag `json:"data"`
}
// Authors
type AuthorsAPIResponse struct {
AuthorList []Author `json:"data"`
}
type AuthorAPIResponse struct {
Author Author `json:"data"`
}
// Feed
type FeedAPIResponse struct {
Data string `json:"data"`
}
// Content Fields
type ContentFieldsAPIResponse struct {
Data map[string]interface{} `json:"data"`
}