feed

package
v0.0.0-...-0a97e14 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNetwork    = errors.New("network unavailable")
	ErrInvalidSource  = errors.New("invalid feed source URL")
	CmdErrXMLParse    = errors.New("Oops.. Something wrong when parsing XML feed")
	CmdNotSupportXML  = errors.New("Encounter unsupport XML type")
	CmdErrUserNetwork = errors.New("Contains unavailble URL or network unavailble")
)
View Source
var RequestCache = make(map[string]Feeder)

Functions

func SaveAsJSON

func SaveAsJSON(newSource []*Source, filePath string) error

func Update

func Update(ss []*entity.Source, c chan *[]*entity.Post)

func WaitDone

func WaitDone()

Types

type CmdController

type CmdController struct{}

func (CmdController) AddNewSource

func (c CmdController) AddNewSource(tunnel chan *logger.Message, category string, urls ...string) (s []*Source, reason error)

AddNewSource bind with CMD: rossy add [url] [url] ...

type Feeder

type Feeder interface {
	Convert() []*entity.Post
	Diff(latest time.Time, underCondition bool) []*entity.Post
}

Feeder in Cache and used by app

type Source

type Source struct {
	Category     string `json:"category"`
	URL          string `json:"url"`
	ETag         string `json:"etag"`
	LastModified string `json:"last_modified"`
	Alias        string `json:"alias"`
	Type         string `json:"type"`
}

func GetSourceByURL

func GetSourceByURL(url string) (*Source, error)

func ReadExistSource

func ReadExistSource(filePath string) ([]*Source, error)

type SourceController

type SourceController interface {
	AddNewSource(url ...string) ([]Source, error)
	SaveSource() error
}

SourceController will response to the costumer like CMD etc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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