images

package
v0.0.0-...-dcf9f25 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURL = "http://www.bing.com/images/search?q="

BaseURL is the Bing Image Search endpoint

View Source
const UserRepo = "angelbarrera92/hasselhoffme"

UserRepo is the name of GitHub repository with wallpaper images

Variables

This section is empty.

Functions

func RandomNumber

func RandomNumber(images []ImageResult) int

RandomNumber returns a randomly selected integer constrained by the length of the []ImageResult array passed to it

func SearchBingImage

func SearchBingImage(searchWord string) (result string)

SearchBingImage returns a random Bing Image Search result

func SearchEmbededImages

func SearchEmbededImages(w string) (result string)

SearchEmbededImages returns a random image result

func SearchGithubRawImages

func SearchGithubRawImages(w string) (result string)

SearchGithubRawImages returns a random image result

Types

type Content

type Content struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Sha         string `json:"sha"`
	Size        int    `json:"size"`
	URL         string `json:"url"`
	HTMLURL     string `json:"html_url"`
	GitURL      string `json:"git_url"`
	DownloadURL string `json:"download_url"`
	TypeObject  string `jbson:"type"`
	Links       Links  `json:"links"`
}

Content represents the GitHub JSON API repositories/contents response body

type ImageResult

type ImageResult struct {
	Source string
	Index  int
}

ImageResult represents a single search result along with its number in results list

type Links struct {
	Self string `json:"message"`
	Git  string `json:"git"`
	HTML string `json:"html"`
}

Links represents the `links` section in GitHub JSON API response

type SearchImageFn

type SearchImageFn func(w string) string

SearchImageFn that returns a random image search result for given query

Jump to

Keyboard shortcuts

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