forked from kallydev/telegraph-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
type.go
44 lines (37 loc) · 1.13 KB
/
type.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
package telegraph
type Account struct {
ShortName string `json:"short_name"`
AuthorName string `json:"author_name"`
AuthorURL string `json:"author_url"`
AccessToken string `json:"access_token,omitempty"`
AuthURL string `json:"auth_url,omitempty"`
PageCount int `json:"page_count,omitempty"`
}
type Page struct {
Path string `json:"path"`
URL string `json:"url"`
Title string `json:"title"`
Description string `json:"description"`
AuthorName string `json:"author_name,omitempty"`
AuthorURL string `json:"author_url,omitempty"`
ImageURL string `json:"image_url,omitempty"`
Content []Node `json:"content,omitempty"`
Views int `json:"views,omitempty"`
CanEdit bool `json:"can_edit,omitempty"`
}
type PageList struct {
TotalCount int `json:"total_count"`
Pages []Page `json:"pages"`
}
type PageViews struct {
Views int `json:"views"`
}
type Node interface{}
var (
_ Node = &NodeElement{}
)
type NodeElement struct {
Tag string `json:"tag"`
Attrs map[string]string `json:"attrs,omitempty"`
Children []Node `json:"children,omitempty"`
}