response structs
This commit is contained in:
@@ -6,6 +6,18 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type WikiResponse struct {
|
||||
Data struct {
|
||||
Pages struct {
|
||||
List []struct {
|
||||
UpdatedAt string
|
||||
Title string
|
||||
Path string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type WikiFetcher struct {
|
||||
Config Config
|
||||
Cache *Cache
|
||||
@@ -18,17 +30,8 @@ func (f WikiFetcher) Fetch() []string {
|
||||
req.Header.Set("Authorization", "Bearer "+f.Config.WikiToken)
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
var r struct {
|
||||
Data struct {
|
||||
Pages struct {
|
||||
List []struct {
|
||||
UpdatedAt string
|
||||
Title string
|
||||
Path string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var r WikiResponse
|
||||
|
||||
if err := getJSON(req, &r); err != nil {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user