api

package
v0.0.0-...-56b4c40 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

This file exposes the http api endpoints and marshals the input and calls the respective service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(s *Service, group *mux.Router)

Types

type FeedService

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

FeedService is implements the API relating to feeds

func (*FeedService) AddFeed

func (s *FeedService) AddFeed(url string) error

AddFeed and then update it

func (*FeedService) DebugFeed

func (s *FeedService) DebugFeed(id int64) ([]byte, error)

func (*FeedService) DeleteFeed

func (s *FeedService) DeleteFeed(id int64) error

func (*FeedService) ListAllFeeds

func (s *FeedService) ListAllFeeds() ([]*db.FeedSource, error)

func (*FeedService) ListAllFeedsWithStats

func (s *FeedService) ListAllFeedsWithStats() ([]*db.FeedSourceWithUnread, error)

func (*FeedService) ToggleActive

func (s *FeedService) ToggleActive(feedID int64) (bool, error)

func (*FeedService) UpdateAllFeeds

func (s *FeedService) UpdateAllFeeds() (int, error)

func (*FeedService) UpdateFeed

func (s *FeedService) UpdateFeed(feedID int64) error

type NewsService

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

NewsService is implements the API

func (*NewsService) ListAllNewsForFeed

func (s *NewsService) ListAllNewsForFeed(feedID int64) ([]*db.ExtendedFeedItem, error)

func (*NewsService) MarkAsRead

func (s *NewsService) MarkAsRead(newsID int64) error

func (*NewsService) MarkAsReadMulti

func (s *NewsService) MarkAsReadMulti(newsID []int64) error

TODO: combine with single

func (*NewsService) Search

func (s *NewsService) Search(param SearchParam) ([]*db.ExtendedFeedItem, error)

func (*NewsService) ToggleNews

func (s *NewsService) ToggleNews(newsID int64, feedID int64) (bool, error)

type SearchParam

type SearchParam struct {
	// false for all
	SearchMode string
	Limit      int
	FeedIDs    []int64
}

type Service

type Service struct {
	*NewsService
	*FeedService
	// contains filtered or unexported fields
}

Service is implements the API

func NewService

func NewService(client *db.Client) *Service

func (Service) AddRegexFilter

func (s Service) AddRegexFilter(feedID int64, regexString string, action db.RuleAction) error

func (Service) HumanClassification

func (s Service) HumanClassification(newsID int64, outcome db.UserClassification) error

func (Service) LearnFromNewNews

func (s Service) LearnFromNewNews() error

func (Service) RunFilter

func (s Service) RunFilter() error

Jump to

Keyboard shortcuts

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