nimbus

package
v0.0.0-...-cfcc9fc Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2015 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublishedAt

func PublishedAt(ss []string) time.Time

func Sum

func Sum(data []byte) string

Types

type Alias

type Alias struct {
	ID        int
	Alias     string `sql:"unique_index"`
	Original  string `sql:"index"`
	CreatedAt time.Time
}

type Cache

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

func NewCache

func NewCache(server string) *Cache

func (Cache) Close

func (c Cache) Close()

func (Cache) Expire

func (c Cache) Expire(url string, seconds int)

func (Cache) Flush

func (c Cache) Flush()

func (Cache) GetFeeds

func (c Cache) GetFeeds(urls []string) (map[string]*json.RawMessage, []string)

func (Cache) Set

func (c Cache) Set(url string, value string)

func (Cache) SetAlias

func (c Cache) SetAlias(alias string, original string)

func (Cache) SetFeed

func (c Cache) SetFeed(url string, feed *Feed)

type Feed

type Feed struct {
	ID         int       `json:"-"`
	Title      string    `json:"title"`
	URL        string    `json:"url" sql:"unique_index"`
	Items      []Item    `json:"items"`
	Sum        string    `json:"-" sql:"index"`
	NextPollAt time.Time `json:"next_poll_at" sql:"index"`
	CreatedAt  time.Time `json:"-"`
	UpdatedAt  time.Time `json:"updated_at"`
}

func NewFeed

func NewFeed(url string, data []byte) (*Feed, error)

func NewFeedFromAtom

func NewFeedFromAtom(af *atom.Feed) *Feed

func NewFeedFromRSS

func NewFeedFromRSS(rf *rss.Feed) *Feed

func NewFeedFromUnknown

func NewFeedFromUnknown(data []byte) (*Feed, error)

func (Feed) Timeout

func (f Feed) Timeout() time.Duration

type Item

type Item struct {
	ID          int       `json:"-"`
	FeedID      int       `json:"-" sql:"index"`
	Title       string    `json:"title"`
	Teaser      string    `json:"teaser" sql:"type:text"`
	URL         string    `json:"url"`
	GUID        string    `json:"guid" sql:"index"`
	PublishedAt time.Time `json:"published_at"`
	CreatedAt   time.Time `json:"-"`
	UpdatedAt   time.Time `json:"-"`
}

Jump to

Keyboard shortcuts

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