db

package
v0.0.0-...-bcb87c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitFeedOptions

type CommitFeedOptions struct {
	// WebhookPending should be true to set the webhook_pending column to true on update/upsert.
	// Since the initial insert is always via HTTP request (not a refresh),
	// there's no point sending a webhook on insert.
	WebhookPending bool
	// WebhookPendingOnInsert is true to set the webhook_pending column true on insert.
	// Generally only useful during testing.
	WebhookPendingOnInsert bool
}

type DB

type DB struct {
	// contains filtered or unexported fields
}

func New

func New(conn IConn) *DB

func (*DB) CommitFeed

func (db *DB) CommitFeed(ctx context.Context, feedStorage feedstorage.Interface, feed *feed.Feed, opts *CommitFeedOptions) error

func (*DB) CommitUnchanged

func (db *DB) CommitUnchanged(ctx context.Context, feed *feed.Feed) error

func (*DB) Conn

func (db *DB) Conn() IConn

func (*DB) ExpireFeed

func (db *DB) ExpireFeed(ctx context.Context, u *url.URL) error

ExpireFeed sets the timestamps on the row to UNIX 0, so TTLs will all be expired. This should rarely be necessary; it will only happen if something manually changes feed storage.

func (*DB) FetchContentsAsFeed

func (db *DB) FetchContentsAsFeed(ctx context.Context, feedStorage feedstorage.Interface, uri *url.URL) (*feed.Feed, error)

func (*DB) FetchFeedRow

func (db *DB) FetchFeedRow(ctx context.Context, uri *url.URL) (*FeedRow, error)

func (*DB) Migrate

func (db *DB) Migrate(ctx context.Context) error

func (*DB) Reset

func (db *DB) Reset(ctx context.Context) error

type FeedRow

type FeedRow struct {
	ContentsMD5          types.MD5Hash
	ContentsLastModified time.Time
	FetchHeaders         feed.HeaderMap
}

type IConn

type IConn interface {
	pgxt.IBegin
	pgxt.IExec
	pgxt.IQueryRow
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL