giapi

package
v0.0.0-...-678509e Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Country    string `json:"country"`
	CurrentURL string `json:"current_url"`
	Origin     string `json:"origin"`
	Path       string `json:"path"`
}

type Data

type Data struct {
	ImageData []ImageData
	ImageSize ImageSize
}

type GoogleImageApi

type GoogleImageApi struct {
	Mutex   *sync.Mutex
	Website Website
	Data    Data
	// contains filtered or unexported fields
}

func NewGoogleImageApi

func NewGoogleImageApi(websiteName string, size ImageSize) *GoogleImageApi

func (*GoogleImageApi) DownloadImage

func (i *GoogleImageApi) DownloadImage(url string, at, fname string)

func (*GoogleImageApi) DownloadImages

func (i *GoogleImageApi) DownloadImages(urls []string, at, fname string)

func (*GoogleImageApi) DownloadUrls

func (i *GoogleImageApi) DownloadUrls(fileName string)

func (*GoogleImageApi) Search

func (i *GoogleImageApi) Search(q string) []ImageData

type Image

type Image struct {
	ID    string    `json:"id"`
	Title string    `json:"title"`
	Info  ImageInfo `json:"orig"`
}

type ImageData

type ImageData struct {
	Context          Context          `json:"context"`
	Images           []Image          `json:"images"`
	RelatedInterests RelatedInterests `json:"seo_related_interests"`
}

type ImageInfo

type ImageInfo struct {
	Width  float64 `json:"width,omitempty"`
	Height float64 `json:"height,omitempty"`
	URL    string  `json:"URL"`
}

type ImageSize

type ImageSize struct {
	MinWidth  float64
	MinHeight float64
}

type RelatedInterests

type RelatedInterests struct {
	Name string `json:"name"`
}

type Website

type Website struct {
	WebsiteName string
	GoogleURL   string
	ImageQuery  string
}

Jump to

Keyboard shortcuts

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