downloader

package
v0.0.0-...-fc12098 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_IMG_SIZE = 10 * 1048576

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectURL

type DirectURL struct{}

func (DirectURL) FromURL

func (method DirectURL) FromURL(source string) (tb.File, error)

func (DirectURL) TransformURL

func (method DirectURL) TransformURL(source string) (string, error)

type Download

type Download struct{}

func (Download) FromURL

func (method Download) FromURL(source string) (tb.File, error)

type ImageFetcher

type ImageFetcher struct {
	UploadMethod
	Original bool
}

func (ImageFetcher) FetchImage

func (fetcher ImageFetcher) FetchImage(source ImageSource) (tb.File, error)

type ImageSource

type ImageSource interface {
	GetSmallImage() string
	GetOriginalImage() string
}

type InlineImageFetcher

type InlineImageFetcher struct {
	InlineImageSource
	Original bool
}

func (InlineImageFetcher) GetImageUrl

func (fetcher InlineImageFetcher) GetImageUrl(source ImageSource) (string, error)

type InlineImageSource

type InlineImageSource interface {
	TransformURL(source string) (string, error)
}

type ProxiedURL

type ProxiedURL struct {
	ProxyHost string
}

func (ProxiedURL) FromURL

func (method ProxiedURL) FromURL(source string) (tb.File, error)

func (ProxiedURL) TransformURL

func (method ProxiedURL) TransformURL(source string) (string, error)

type UploadMethod

type UploadMethod interface {
	FromURL(source string) (tb.File, error)
}

Jump to

Keyboard shortcuts

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