chore: improve fetch functionality

This commit is contained in:
xuu committed 2024-11-11 19:13:34 -07:00
1 parent d8b87a0072
commit 0ea449264a
6 files changed
+310 -80

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
package main
import (
"context"
"database/sql"
)
type Feed struct {
FeedID uuid
URI string
Nick string
LastScanOn sql.NullTime
RefreshRate int
LastModified sql.NullTime
LastError sql.NullString
ETag sql.NullString
DiscloseFeedURL string
DiscloseNick string
Version string
}
func (f *Feed) Save(ctx context.Context, db *sql.DB) error {
_, err := db.ExecContext(
ctx,
updateFeed,
f.LastScanOn,
f.RefreshRate,
f.LastModified,
f.ETag,
f.LastError,
f.FeedID,
)
return err
}