response structs

This commit is contained in:
2026-01-19 23:01:16 +01:00
parent ee6dfca55f
commit a89c320106
3 changed files with 38 additions and 28 deletions

View File

@@ -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{}
}