images

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBrokenImage = fmt.Errorf("broken image")

Functions

This section is empty.

Types

type DownloadResult added in v0.3.1

type DownloadResult struct {
	Downloaded int
	Missing    int
}

type ImageDownloader

type ImageDownloader interface {
	Download(c *card.Card, lang string, afterDownload func(result *ImageResult) error) (*DownloadResult, error)
}

type ImageResult

type ImageResult struct {
	MatchingFaceID int64
	MimeType       fetch.MimeType
	File           io.Reader
}

type Images

type Images interface {
	Import(PageConfig) (*Report, error)
}

func NewImporter

func NewImporter(cardDao *card.PostgresCardDao, storage storage.Storage, downloader ImageDownloader) Images

type PageConfig

type PageConfig struct {
	Page int // starts with 1
	Size int
}

type Report

type Report struct {
	TotalCards int
	Downloaded int
	Missing    int
	Skipped    int
}

Jump to

Keyboard shortcuts

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