publisher

package
v0.0.0-...-6232422 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Telegram const.
	Telegram = "telegram"
	// Stdout const.
	Stdout = "stdout"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Title              string
	URL                string
	DiscountPercentage *string
	Price              *float64
}

Item struct.

type Publisher

type Publisher interface {
	Publish(item Item)
}

Publisher is a publisher interface.

type Publishers

type Publishers struct {
	TelegramPublisher *TelegramPublisher
	StdoutPublisher   *StdoutPublisher
}

Publishers contains the available publishers.

func NewPublishers

func NewPublishers() Publishers

NewPublishers creates a new Publishers struct.

func (*Publishers) GetPublisher

func (v *Publishers) GetPublisher(scraperName string) Publisher

GetPublisher returns a new Publisher based on a provided name.

type StdoutPublisher

type StdoutPublisher struct{}

StdoutPublisher struct.

func NewStdoutPublisher

func NewStdoutPublisher() *StdoutPublisher

NewStdoutPublisher returns an StdoutPublisher.

func (*StdoutPublisher) Publish

func (dv *StdoutPublisher) Publish(item Item)

Publish publishes the scraped item to stdout.

type TelegramPublisher

type TelegramPublisher struct{}

TelegramPublisher struct.

func NewTelegramPublisher

func NewTelegramPublisher() *TelegramPublisher

NewTelegramPublisher returns a TelegramPublisher.

func (*TelegramPublisher) Publish

func (dv *TelegramPublisher) Publish(item Item)

Publish publishes the scraped item to telegram.

Jump to

Keyboard shortcuts

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