app

package
v0.0.0-...-af5a276 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Unlicense Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDuration

func NewDuration(d time.Duration) *time.Duration

func RunDownloader

func RunDownloader(downloaderType DownloaderType, outputPath string, options *Option) error

func ToPng

func ToPng(imageBytes []byte) ([]byte, error)

ToPng converts an image to png

Types

type Comic

type Comic struct {
	ImageData []byte
	Title     string
}

type ComicDownloader

type ComicDownloader interface {
	// Returns the comic image as bytes (png or jpg), title, and any error
	DownloadComic(time.Time) (*Comic, error)
}

type DilbertComic

type DilbertComic struct {
	ImageUrl string
	Title    string
}

type DilbertComicClient

type DilbertComicClient struct {
	BaseUrl *url.URL
}

func NewDilbertComicCilent

func NewDilbertComicCilent(baseUrl string) (*DilbertComicClient, error)

func (*DilbertComicClient) ComicForDate

func (c *DilbertComicClient) ComicForDate(t time.Time) (*DilbertComic, error)

type DilbertDownloader

type DilbertDownloader struct {
}

func (*DilbertDownloader) DownloadComic

func (d *DilbertDownloader) DownloadComic(t time.Time) (*Comic, error)

type DownloaderContext

type DownloaderContext struct {
	Type         DownloaderType
	LastDownload *time.Time
	// contains filtered or unexported fields
}

func (*DownloaderContext) Run

func (ctx *DownloaderContext) Run(t time.Time) error

type DownloaderType

type DownloaderType string
const (
	DownloaderTypeUnknown DownloaderType = "unknown"
	DownloaderTypeXkcd    DownloaderType = "xkcd"
	DownloaderTypeDilbert DownloaderType = "dilbert"
)

type EpdDisplayer

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

func NewEpdDisplayer

func NewEpdDisplayer() *EpdDisplayer

func (*EpdDisplayer) Update

func (d *EpdDisplayer) Update() error

func (*EpdDisplayer) WriteImage

func (d *EpdDisplayer) WriteImage(img image.Image) error

func (*EpdDisplayer) WriteText

func (d *EpdDisplayer) WriteText(text string) error

type Option

type Option struct {
	TickDuration *time.Duration
	CnCAddress   string
	ClientId     string
}

type XkcdDownloader

type XkcdDownloader struct {
}

func (*XkcdDownloader) DownloadComic

func (x *XkcdDownloader) DownloadComic(t time.Time) (*Comic, error)

Jump to

Keyboard shortcuts

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