Documentation ¶
Index ¶
Constants ¶
const BaseURL = "http://www.bing.com/images/search?q="
BaseURL is the Bing Image Search endpoint
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 ¶
SearchBingImage returns a random Bing Image Search result
func SearchEmbededImages ¶
SearchEmbededImages returns a random image result
func SearchGithubRawImages ¶
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 ¶
ImageResult represents a single search result along with its number in results list
type Links ¶
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 ¶
SearchImageFn that returns a random image search result for given query