xt/feed.go

39 lines
562 B
Go
Raw Permalink Normal View History

2024-11-11 19:13:34 -07:00
package main
import (
"context"
"database/sql"
)
type Feed struct {
FeedID uuid
2024-11-20 09:05:05 -07:00
FetchURI string
2024-11-11 19:13:34 -07:00
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
}