fetcher

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingImageURL = apperrors.Business("missing image url", "FETCHER:MISSING_IMAGE_URL")
	ErrFailToHash      = apperrors.System(nil, "fail to hash", "STAGES:FAIL_TO_HASH")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	SourceURL     string
	DefaultWidth  int
	DefaultHeight int
}

type Result

type Result struct {
	Title      string
	Text       string
	SiteName   string
	ImageURL   string
	DomainName string
	URL        string
	Hash       string
}

func Fetch

func Fetch(ctx context.Context, opt Options) (Result, error)

func (Result) FetchImage

func (f Result) FetchImage(ctx context.Context, target io.Writer) error

func (Result) ImageName

func (f Result) ImageName() string

Jump to

Keyboard shortcuts

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