google_images

package
v0.0.0-...-eb4b608 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoImagesFound            = errors.New("no images found")
	ErrCouldNotDownloadAnyImage = errors.New("could not download any image")
)

Functions

This section is empty.

Types

type CleanupService

type CleanupService interface {
	Cleanup() error
}

type GoogleImage

type GoogleImage struct {
	Link  string `json:"link"`
	Mime  string `json:"mime"`
	Image struct {
		ContextLink string `json:"contextLink"`
	} `json:"image"`
}
func (gi GoogleImage) ContextLink() string
func (gi GoogleImage) ImageLink() string

func (GoogleImage) IsGIF

func (gi GoogleImage) IsGIF() bool

type Plugin

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

func New

func New(credentialService model.CredentialService, googleImagesService Service, cleanupService CleanupService) *Plugin

func (*Plugin) Commands

func (p *Plugin) Commands() []telebot.Command

func (*Plugin) Handlers

func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler

func (*Plugin) Name

func (p *Plugin) Name() string

type Response

type Response struct {
	Items []GoogleImage `json:"items"`
}

type Service

type Service interface {
	GetImages(query string) (model.GoogleImages, error)
	GetImagesFromQueryID(queryID int64) (model.GoogleImages, error)
	SaveImages(query string, wrapper *model.GoogleImages) (int64, error)
	SaveIndex(queryID int64, index int) error
}

Jump to

Keyboard shortcuts

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