aggregator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotModified = errors.New("not modified")

Functions

This section is empty.

Types

type Feed

type Feed struct {
	*gofeed.Feed

	ETag         string
	LastModified string
}

type MastodonPoller

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

func NewMastodonPoller

func NewMastodonPoller(cfg *common.Config, db *server.DB, newCh chan common.AggregatorItem) (*MastodonPoller, error)

func (*MastodonPoller) GrabTimeline

func (m *MastodonPoller) GrabTimeline()

func (*MastodonPoller) HandleHTTP

func (m *MastodonPoller) HandleHTTP(c *gin.Context)

type PollerData

type PollerData struct {
	ID          int    `json:"id,omitempty"`
	Type        string `json:"type"`
	Kind        string `json:"kind"`
	Skey        string `json:"skey"`
	LastSeenStr string `json:"last_seen_str"`
	LastSeenInt int64  `json:"last_seen_int"`
}

func GetRunData

func GetRunData(db *server.DB, skey string) *PollerData

func (*PollerData) GetID

func (p *PollerData) GetID() int

func (*PollerData) SetID

func (p *PollerData) SetID(id int)

type RssItem

type RssItem struct {
	*gofeed.Item `binding:"required"`
	FeedTitle    string `json:"feed_title"`
	FeedUrl      string `json:"feed_url"`
}

func (RssItem) ToDoc

func (ri RssItem) ToDoc() (*common.Doc, error)

type RssPoller

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

func NewRssPoller

func NewRssPoller(cfg *common.Config,
	db *server.DB,
	newCh chan common.AggregatorItem,
	newSubCh chan *common.Sub) *RssPoller

func (*RssPoller) GetFromURL

func (r *RssPoller) GetFromURL(sub *common.Sub) (*Feed, error)

Calls the feed url with conditional headers. See https://github.com/mmcdole/gofeed/issues/111#issuecomment-450956821

func (*RssPoller) GrabFeed

func (r *RssPoller) GrabFeed(sub *common.Sub) error

func (*RssPoller) GrabFeeds

func (r *RssPoller) GrabFeeds()

func (*RssPoller) HandleHTTP

func (r *RssPoller) HandleHTTP(c *gin.Context)

func (*RssPoller) HandleNewSubs

func (r *RssPoller) HandleNewSubs()

func (*RssPoller) Run

func (r *RssPoller) Run()

type Status

type Status struct {
	*mastodon.Status `binding:"required"`
	User             *mastodon.Account
}

func (*Status) ToDoc

func (s *Status) ToDoc() (*common.Doc, error)

type Tweet

type Tweet struct {
	*twitter.Tweet `binding:"required"`
	Account        *twitter.User
}

func (Tweet) ToDoc

func (w Tweet) ToDoc() (*common.Doc, error)

type TwitterPoller

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

func NewTwitterPoller

func NewTwitterPoller(cfg *common.Config, db *server.DB, newCh chan common.AggregatorItem) (*TwitterPoller, error)

func (*TwitterPoller) GrabTimeline

func (t *TwitterPoller) GrabTimeline()

func (*TwitterPoller) HandleHTTP

func (t *TwitterPoller) HandleHTTP(c *gin.Context)

Jump to

Keyboard shortcuts

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