news

package
v0.0.0-...-bb3eb04 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API exposes an implementation of the NewsServiceServer interface.

func NewAPI

func NewAPI(logger *zap.Logger) *API

NewAPI creates a new instance of the API struct.

func (*API) ListArticles

func (a *API) ListArticles(ctx context.Context, req *ListArticlesRequest) (*ListArticlesResponse, error)

ListArticles returns a collection of articles to the requester.

func (*API) StreamNewsUpdates

func (a *API) StreamNewsUpdates(*StreamNewsUpdatesRequest, NewsService_StreamNewsUpdatesServer) error

StreamNewsUpdates streams live article updates to subscribers.

type BBCFeed

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

BBCFeed is a news feed provided by the British Broadcasting Corporation

func NewBBCFeed

func NewBBCFeed(logger *zap.Logger, path string, api *API) *BBCFeed

NewBBCFeed creates a new news feed from the BBC.

func (*BBCFeed) Run

func (bbc *BBCFeed) Run(ctx context.Context)

Run begins a loop that will poll BBC for changes.

type CBCFeed

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

CBCFeed is a news feed provided by CBC News

func NewCBCFeed

func NewCBCFeed(logger *zap.Logger, path string, api *API) *CBCFeed

NewCBCFeed creates a new news feed from the CBC.

func (*CBCFeed) Run

func (cbc *CBCFeed) Run(ctx context.Context)

Run begins a loop that will poll CBC for changes.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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