Update deps, refactoring

This commit is contained in:
2023-11-01 12:53:43 +03:00
parent 7cd4d4097a
commit e652abb4bd
24 changed files with 540 additions and 238 deletions

View File

@@ -45,29 +45,35 @@ type Meta struct {
Error string
}
func NewPage(url string, description string, formats ...Format) *Page {
return &Page{
ID: uuid.New(),
URL: url,
Description: description,
Formats: formats,
Created: time.Now(),
Version: 1,
}
}
type Page struct {
type PageBase struct {
ID uuid.UUID
URL string
Description string
Created time.Time
Formats []Format
Results ResultsRO
Version uint16
Status Status
Meta Meta
}
func NewPage(url string, description string, formats ...Format) *Page {
return &Page{
PageBase: PageBase{
ID: uuid.New(),
URL: url,
Description: description,
Formats: formats,
Created: time.Now(),
Version: 1,
},
}
}
type Page struct {
PageBase
Results ResultsRO
}
func (p *Page) SetProcessing() {
p.Status = StatusProcessing
}