bringer

package
v0.0.0-...-5b391e0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package bringer will have multiple feed bringers from different sources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HNBringer

type HNBringer struct {
	NumberOfItems int
	Ctx           context.Context
	NWorkers      int
}

HNBringer brings news from hn

func (*HNBringer) Bring

func (b *HNBringer) Bring(ids []int) ([]*app.Item, error)

Bring hn news

func (b *HNBringer) GetDiscussLink(id interface{}) string

GetDiscussLink makes a discuss url for the given id

func (*HNBringer) GetSource

func (b *HNBringer) GetSource() string

GetSource tells source identifier of items

func (*HNBringer) GetURL

func (b *HNBringer) GetURL(id interface{}) string

GetURL makes an url for the given id

func (*HNBringer) SetContext

func (b *HNBringer) SetContext(ctx context.Context)

SetContext sets context

type PeriodicBringer

type PeriodicBringer struct {
	Ctx      context.Context
	Interval time.Duration
	Bringer  app.Bringer
}

PeriodicBringer sends any bringer periodically to maintainer

func (*PeriodicBringer) Bring

func (pb *PeriodicBringer) Bring() <-chan app.Bringer

Bring gives a hn bringer periodically

type RandBringer

type RandBringer struct {
	Ctx context.Context
}

RandBringer brings random items

func (*RandBringer) Bring

func (b *RandBringer) Bring(ids []int) ([]*app.Item, error)

Bring random news

func (b *RandBringer) GetDiscussLink(id interface{}) string

GetDiscussLink makes a discuss url for the given id

func (*RandBringer) GetSource

func (b *RandBringer) GetSource() string

GetSource tells source identifier of items

func (*RandBringer) GetURL

func (b *RandBringer) GetURL(id interface{}) string

GetURL makes an url for the given id

func (*RandBringer) SetContext

func (b *RandBringer) SetContext(ctx context.Context)

SetContext sets context

Jump to

Keyboard shortcuts

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