response structs
This commit is contained in:
@@ -5,6 +5,14 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type RedmineResponse struct {
|
||||
Issues []struct {
|
||||
ID int
|
||||
UpdatedOn string
|
||||
Subject string
|
||||
}
|
||||
}
|
||||
|
||||
type RedmineFetcher struct {
|
||||
Config Config
|
||||
Cache *Cache
|
||||
@@ -15,13 +23,8 @@ func (f RedmineFetcher) Fetch() []string {
|
||||
req, _ := http.NewRequest("GET", redmineURL, nil)
|
||||
req.Header.Set("X-Redmine-API-Key", f.Config.RedmineKey)
|
||||
|
||||
var r struct {
|
||||
Issues []struct {
|
||||
ID int
|
||||
UpdatedOn string
|
||||
Subject string
|
||||
}
|
||||
}
|
||||
var r RedmineResponse
|
||||
|
||||
if err := getJSON(req, &r); err != nil {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user