models

package
v0.0.0-...-4f0ea1d Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feed

type Feed struct {
	ID          uint      `gorm:"primaryKey" json:"-"`
	Url         string    `json:"url"`
	Title       string    `json:"title"`
	Link        string    `json:"link"`
	Description string    `json:"description"`
	Image       *string   `json:"image"`
	CreatedAt   time.Time `json:"-"`
	UpdatedAt   time.Time `json:"-"`
}

A feed that is being subscribed to

func CreateOrUpdateFeed

func CreateOrUpdateFeed(db *gorm.DB, feed *Feed) (*Feed, bool, error)

Create a new feed or update if the feed already exists

type FeedItem

type FeedItem struct {
	ID          uint `gorm:"primaryKey"`
	Title       string
	Link        string
	Description string
	Author      string
	Image       *string
	Published   time.Time
	FeedID      uint
	Feed        Feed
}

An item in a feed

func CreateOrUpdateFeedItem

func CreateOrUpdateFeedItem(db *gorm.DB, item *FeedItem) (*FeedItem, bool, error)

Create a new feed item or update if the item already exists

func (FeedItem) SimpleDescription

func (item FeedItem) SimpleDescription() string

Returns a simplified description, removing HTML tags and shortening it.

Jump to

Keyboard shortcuts

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