xt/feed.go
2024-11-20 09:05:05 -07:00

39 lines
562 B
Go

package main
import (
"context"
"database/sql"
)
type Feed struct {
FeedID uuid
FetchURI string
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
}