pgfeed

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBCategory

type DBCategory struct {
	UUID     string `db:"uuid"`
	UserUUID string `db:"user_uuid"`

	Name string `db:"name"`
	Slug string `db:"slug"`

	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type DBEntry

type DBEntry struct {
	UID      string `db:"uid"`
	FeedUUID string `db:"feed_uuid"`

	URL           string   `db:"url"`
	Title         string   `db:"title"`
	Summary       string   `db:"summary"`
	TextRankTerms []string `db:"textrank_terms"`

	PublishedAt time.Time `db:"published_at"`
	UpdatedAt   time.Time `db:"updated_at"`
}

type DBEntryMetadata

type DBEntryMetadata struct {
	UserUUID string `db:"user_uuid"`
	EntryUID string `db:"entry_uid"`
	Read     bool   `db:"read"`
}

type DBFeed

type DBFeed struct {
	UUID string `db:"uuid"`

	FeedURL     string `db:"feed_url"`
	Title       string `db:"title"`
	Description string `db:"description"`
	Slug        string `db:"slug"`

	ETag         string    `db:"etag"`
	LastModified time.Time `db:"last_modified"`

	// xxHash64 returns a 64-bit unsigned integer hash value,
	// whereas it is stored as a 64-bit signed integer in the database (BIGINT).
	Hash int64 `db:"hash_xxhash64"`

	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	FetchedAt time.Time `db:"fetched_at"`
}

type DBQueryingSubscribedFeedEntry

type DBQueryingSubscribedFeedEntry struct {
	DBEntry

	SubscriptionAlias string `db:"subscription_alias"`
	FeedTitle         string `db:"feed_title"`
	Read              bool   `db:"read"`
}

type DBQueryingSubscription

type DBQueryingSubscription struct {
	SubscriptionUUID  string `db:"uuid"`
	SubscriptionAlias string `db:"alias"`
	CategoryUUID      string `db:"category_uuid"`

	FeedTitle       string `db:"title"`
	FeedDescription string `db:"description"`
}

type DBSubscribedFeed

type DBSubscribedFeed struct {
	UUID    string `db:"uuid"`
	FeedURL string `db:"feed_url"`
	Title   string `db:"title"`
	Slug    string `db:"slug"`

	Alias  string `db:"alias"`
	Unread uint   `db:"unread"`

	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
	FetchedAt time.Time `db:"fetched_at"`
}

type DBSubscription

type DBSubscription struct {
	UUID         string `db:"uuid"`
	CategoryUUID string `db:"category_uuid"`
	FeedUUID     string `db:"feed_uuid"`
	UserUUID     string `db:"user_uuid"`

	Alias string `db:"alias"`

	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Repository

type Repository struct {
	*pgbase.Repository
}

func NewRepository

func NewRepository(pool *pgxpool.Pool) *Repository

func (*Repository) FeedCategoryCreate

func (r *Repository) FeedCategoryCreate(c feed.Category) error

func (*Repository) FeedCategoryDelete

func (r *Repository) FeedCategoryDelete(userUUID string, categoryUUID string) error

func (*Repository) FeedCategoryGetByName

func (r *Repository) FeedCategoryGetByName(userUUID string, name string) (feed.Category, error)

func (*Repository) FeedCategoryGetBySlug

func (r *Repository) FeedCategoryGetBySlug(userUUID string, slug string) (feed.Category, error)

func (*Repository) FeedCategoryGetByUUID

func (r *Repository) FeedCategoryGetByUUID(userUUID string, categoryUUID string) (feed.Category, error)

func (*Repository) FeedCategoryGetMany

func (r *Repository) FeedCategoryGetMany(userUUID string) ([]feed.Category, error)

func (*Repository) FeedCategoryNameAndSlugAreRegistered

func (r *Repository) FeedCategoryNameAndSlugAreRegistered(userUUID string, name string, slug string) (bool, error)

func (*Repository) FeedCategoryNameAndSlugAreRegisteredToAnotherCategory

func (r *Repository) FeedCategoryNameAndSlugAreRegisteredToAnotherCategory(userUUID string, categoryUUID string, name string, slug string) (bool, error)

func (*Repository) FeedCategorySubscriptionsGetAll

func (r *Repository) FeedCategorySubscriptionsGetAll(userUUID string) ([]feedexporting.CategorySubscriptions, error)

func (*Repository) FeedCategoryUpdate

func (r *Repository) FeedCategoryUpdate(c feed.Category) error

func (*Repository) FeedCreate

func (r *Repository) FeedCreate(f feed.Feed) error

func (*Repository) FeedEntryCreateMany

func (r *Repository) FeedEntryCreateMany(entries []feed.Entry) (int64, error)

func (*Repository) FeedEntryGetCount

func (r *Repository) FeedEntryGetCount(userUUID string) (uint, error)

func (*Repository) FeedEntryGetCountByCategory

func (r *Repository) FeedEntryGetCountByCategory(userUUID string, categoryUUID string) (uint, error)

func (*Repository) FeedEntryGetCountByCategoryAndQuery

func (r *Repository) FeedEntryGetCountByCategoryAndQuery(userUUID string, categoryUUID string, searchTerms string) (uint, error)

func (*Repository) FeedEntryGetCountByQuery

func (r *Repository) FeedEntryGetCountByQuery(userUUID string, searchTerms string) (uint, error)

func (*Repository) FeedEntryGetCountBySubscription

func (r *Repository) FeedEntryGetCountBySubscription(userUUID string, subscriptionUUID string) (uint, error)

func (*Repository) FeedEntryGetCountBySubscriptionAndQuery

func (r *Repository) FeedEntryGetCountBySubscriptionAndQuery(userUUID string, subscriptionUUID string, searchTerms string) (uint, error)

func (*Repository) FeedEntryMarkAllAsRead

func (r *Repository) FeedEntryMarkAllAsRead(userUUID string) error

func (*Repository) FeedEntryMarkAllAsReadByCategory

func (r *Repository) FeedEntryMarkAllAsReadByCategory(userUUID string, categoryUUID string) error

func (*Repository) FeedEntryMarkAllAsReadBySubscription

func (r *Repository) FeedEntryMarkAllAsReadBySubscription(userUUID string, subscriptionUUID string) error

func (*Repository) FeedEntryMetadataCreate

func (r *Repository) FeedEntryMetadataCreate(entryMetadata feed.EntryMetadata) error

func (*Repository) FeedEntryMetadataGetByUID

func (r *Repository) FeedEntryMetadataGetByUID(userUUID string, entryUID string) (feed.EntryMetadata, error)

func (*Repository) FeedEntryMetadataUpdate

func (r *Repository) FeedEntryMetadataUpdate(entryMetadata feed.EntryMetadata) error

func (*Repository) FeedEntryUpsertMany

func (r *Repository) FeedEntryUpsertMany(entries []feed.Entry) (int64, error)

func (*Repository) FeedGetBySlug

func (r *Repository) FeedGetBySlug(feedSlug string) (feed.Feed, error)

func (*Repository) FeedGetByURL

func (r *Repository) FeedGetByURL(feedURL string) (feed.Feed, error)

func (*Repository) FeedGetByUUID

func (r *Repository) FeedGetByUUID(feedUUID string) (feed.Feed, error)

func (*Repository) FeedGetNByLastSynchronizationTime

func (r *Repository) FeedGetNByLastSynchronizationTime(n uint, before time.Time) ([]feed.Feed, error)

func (*Repository) FeedQueryingSubscriptionByUUID

func (r *Repository) FeedQueryingSubscriptionByUUID(userUUID string, subscriptionUUID string) (feedquerying.Subscription, error)

func (*Repository) FeedQueryingSubscriptionsByCategory

func (r *Repository) FeedQueryingSubscriptionsByCategory(userUUID string) ([]feedquerying.SubscriptionsByCategory, error)

func (*Repository) FeedSubscriptionCategoryGetAll

func (r *Repository) FeedSubscriptionCategoryGetAll(userUUID string) ([]feedquerying.SubscribedFeedsByCategory, error)

func (*Repository) FeedSubscriptionCreate

func (r *Repository) FeedSubscriptionCreate(s feed.Subscription) (feed.Subscription, error)

func (*Repository) FeedSubscriptionDelete

func (r *Repository) FeedSubscriptionDelete(userUUID string, subscriptionUUID string) error

func (*Repository) FeedSubscriptionEntryGetN

func (r *Repository) FeedSubscriptionEntryGetN(userUUID string, n uint, offset uint) ([]feedquerying.SubscribedFeedEntry, error)

func (*Repository) FeedSubscriptionEntryGetNByCategory

func (r *Repository) FeedSubscriptionEntryGetNByCategory(userUUID string, categoryUUID string, n uint, offset uint) ([]feedquerying.SubscribedFeedEntry, error)

func (*Repository) FeedSubscriptionEntryGetNByCategoryAndQuery

func (r *Repository) FeedSubscriptionEntryGetNByCategoryAndQuery(userUUID string, categoryUUID string, searchTerms string, n uint, offset uint) ([]feedquerying.SubscribedFeedEntry, error)

func (*Repository) FeedSubscriptionEntryGetNByQuery

func (r *Repository) FeedSubscriptionEntryGetNByQuery(userUUID string, searchTerms string, n uint, offset uint) ([]feedquerying.SubscribedFeedEntry, error)

func (*Repository) FeedSubscriptionEntryGetNBySubscription

func (r *Repository) FeedSubscriptionEntryGetNBySubscription(userUUID string, subscriptionUUID string, n uint, offset uint) ([]feedquerying.SubscribedFeedEntry, error)

func (*Repository) FeedSubscriptionEntryGetNBySubscriptionAndQuery

func (r *Repository) FeedSubscriptionEntryGetNBySubscriptionAndQuery(userUUID string, subscriptionUUID string, searchTerms string, n uint, offset uint) ([]feedquerying.SubscribedFeedEntry, error)

func (*Repository) FeedSubscriptionGetByFeed

func (r *Repository) FeedSubscriptionGetByFeed(userUUID string, feedUUID string) (feed.Subscription, error)

func (*Repository) FeedSubscriptionGetByUUID

func (r *Repository) FeedSubscriptionGetByUUID(userUUID string, subscriptionUUID string) (feed.Subscription, error)

func (*Repository) FeedSubscriptionIsRegistered

func (r *Repository) FeedSubscriptionIsRegistered(userUUID string, feedUUID string) (bool, error)

func (*Repository) FeedSubscriptionUpdate

func (r *Repository) FeedSubscriptionUpdate(s feed.Subscription) error

func (*Repository) FeedUpdateFetchMetadata

func (r *Repository) FeedUpdateFetchMetadata(feedFetchMetadata feedsynchronizing.FeedFetchMetadata) error

func (*Repository) FeedUpdateMetadata

func (r *Repository) FeedUpdateMetadata(feedMetadata feedsynchronizing.FeedMetadata) error

Jump to

Keyboard shortcuts

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