tools

package
v0.0.0-...-58a9d69 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchLocation

func FetchLocation(searchText string) (latitude float64, longitude float64, placeName string, err error)

func FetchWeather

func FetchWeather(latitude float64, longitude float64) (temperature int, humidity int, description string, icon string, isDay string, err error)

func LoadEnv

func LoadEnv()

Types

type Feature

type Feature struct {
	PlaceName string    `json:"place_name"`
	Center    []float64 `json:"center"`
}

type Location

type Location struct {
	Type        string    `json:"type"`
	Query       []string  `json:"query"`
	Attribution string    `json:"attribution"`
	Features    []Feature `json:"features"`
}

type Weather

type Weather struct {
	Current struct {
		Temperature         int      `json:"temperature"`
		WeatherIcons        []string `json:"weather_icons"`
		WeatherDescriptions []string `json:"weather_descriptions"`
		Humidity            int      `json:"humidity"`
		IsDay               string   `json:"is_day"`
	} `json:"current"`
}

Jump to

Keyboard shortcuts

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