data

package
v0.0.0-...-858f5d4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	gorm.Model

	Name   string
	User   *User
	UserID uint64 `gorm:"index"`
	Feeds  []Feed `gorm:"many2many:feed_categories;"`
}

Category represents a group of feeds

type Feed

type Feed struct {
	gorm.Model

	Title        string
	URL          string `gorm:"not null:unique"`
	Description  string
	SiteURL      string
	Favicon      string
	Domain       string
	RequiresAuth bool
	Auth         string
	HotLinking   bool
	Unread       int
	LastFetch    time.Time
	AddedByID    uint
	AddedBy      *User
}

Feed is the a url pointing to an RSS or Atom feed

type FunnelDB

type FunnelDB struct {
	Conn *gorm.DB
}

FunnelDB wraps a gorm.DB connection and provides a useful interface for interacting with the database.

func New

func New(conf *config.Config) (*FunnelDB, error)

New returns a new instance of FunnelDB or an error

func (*FunnelDB) Close

func (f *FunnelDB) Close() error

type Item

type Item struct {
	gorm.Model

	Feed        *Feed
	FeedID      uint `gorm:"index"`
	UID         string
	Title       string
	Author      string
	Description string
	Link        string
	PostedAt    time.Time
}

Item is a single feed item. This is usually a post belonging to the feed

type ItemMeta

type ItemMeta struct {
	ItemID   uint
	UserID   uint
	User     *User
	Saved    bool
	ReadTime time.Time `gorm:"null"`
}

type Settings

type Settings struct {
	gorm.Model

	RefreshRate int
}

Settings represents the global configuration

type Subscription

type Subscription struct {
	FeedID     uint
	UserID     uint
	Categories []Category `gorm:"many2many:subscription_categories"`
}

type SubscriptionCategory

type SubscriptionCategory struct {
	FeedID     uint
	CategoryID uint
}

type User

type User struct {
	gorm.Model

	Email    string `gorm:"type:varchar(100);unique"`
	Password string
	Admin    bool
	Feeds    []Feed `gorm:"many2many:subscriptions;"`
}

User represents the loginable users

Jump to

Keyboard shortcuts

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