Move all structs to model.go

This commit is contained in:
Joakim Hellsén 2024-02-04 17:09:52 +01:00
commit a7630d7443
2 changed files with 27 additions and 26 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"net/http"
"time"
"gorm.io/gorm"
@ -155,3 +156,25 @@ type Extension struct {
Attrs map[string]string `gorm:"type:json" json:"attrs"`
Children map[string][]Extension `gorm:"type:json" json:"children"`
}
type TemplateData struct {
Title string
Description string
Keywords string
Author string
CanonicalURL string
FeedCount int
DatabaseSize string
Request *http.Request
ParseErrors []ParseResult
}
type ParseResult struct {
FeedURL string
Msg string
IsError bool
}
func (d *TemplateData) GetDatabaseSizeAndFeedCount() {
d.DatabaseSize = GetDBSize()
}