cmd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Copyright © 2024 github.com/ericmariot <[email protected]>

Copyright © 2024 github.com/ericmariot <[email protected]>

Copyright © 2024 github.com/ericmariot <[email protected]>

Copyright © 2024 github.com/ericmariot <[email protected]>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Types

type CityCoordinates

type CityCoordinates struct {
	Latitude  string `json:"lat"`
	Longitude string `json:"lon"`
	Name      string `json:"name"`
}

type Config

type Config struct {
	City            string                     `json:"city"`
	LastIP          string                     `json:"last_ip"`
	CityCoordinates map[string]CityCoordinates `json:"city_coordinates"`
}

type ConfigLoader

type ConfigLoader interface {
	LoadConfig() (Config, error)
	SaveConfig(Config) error
}

type GeoLocator

type GeoLocator interface {
	CityToGeoLoc(city string) (string, string, string, error)
}

type IPInfo

type IPInfo struct {
	City string `json:"city"`
}

type RealConfigLoader

type RealConfigLoader struct{}

func (*RealConfigLoader) LoadConfig

func (r *RealConfigLoader) LoadConfig() (Config, error)

func (*RealConfigLoader) SaveConfig

func (r *RealConfigLoader) SaveConfig(config Config) error

type RealGeoLocator

type RealGeoLocator struct{}

func (*RealGeoLocator) CityToGeoLoc

func (r *RealGeoLocator) CityToGeoLoc(city string) (string, string, string, error)

type Weather

type Weather struct {
	Timezone string `json:"timezone"`
	Current  struct {
		Time        string  `json:"time"`
		Temperature float64 `json:"temperature_2m"`
		Rain        float64 `json:"precipitation"`
		IsDay       int64   `json:"is_day"`
	} `json:"current"`
	Hourly struct {
		Time        []string  `json:"time"`
		Temperature []float64 `json:"temperature_2m"`
		RainChance  []int64   `json:"precipitation_probability"`
		CloudCover  []int64   `json:"cloud_cover"`
	} `json:"hourly"`
}

Jump to

Keyboard shortcuts

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