database

package
v0.0.0-...-185b973 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func Connect

func Connect(dsn string) (*Database, error)

func (*Database) CreateItem

func (d *Database) CreateItem(feed *Feed, item *Item) error

func (*Database) GetFeeds

func (d *Database) GetFeeds() ([]Feed, error)

func (*Database) GetItems

func (d *Database) GetItems() ([]Item, error)

type Feed

type Feed struct {
	gorm.Model

	// properties
	Title       string
	Description string
	Link        string

	// relationships
	Items []Item
}

type Item

type Item struct {
	gorm.Model

	// properties
	Title       string
	Description string
	Link        string
	GUID        string `gorm:"index:idx_item"`
	PublishDate *time.Time

	// relationships
	FeedID uint
	Feed   Feed
}

Jump to

Keyboard shortcuts

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