plugin

package
v0.0.0-...-48f88d4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	URL = "https://devapi.qweather.com/v7/"
	Key = os.Getenv("QWEATHER_KEY")
)
View Source
var WhenIConfess = time.Date(2021, time.November, 27, 0, 0, 0, 0, time.Local)

WhenIConfess 2021-11-27 00:00

Functions

This section is empty.

Types

type DayPlugin

type DayPlugin struct {
}

func NewDayPlugin

func NewDayPlugin() *DayPlugin

func (*DayPlugin) Funcs

func (plugin *DayPlugin) Funcs() template.FuncMap

func (*DayPlugin) LoveAnniversaryDays

func (plugin *DayPlugin) LoveAnniversaryDays() int

func (*DayPlugin) Name

func (plugin *DayPlugin) Name() string

type Plugin

type Plugin interface {
	Name() string
	Funcs() template.FuncMap
}

type WeatherPlugin

type WeatherPlugin struct {
	// contains filtered or unexported fields
}

func NewWeatherPlugin

func NewWeatherPlugin(key string) *WeatherPlugin

func (*WeatherPlugin) Funcs

func (plugin *WeatherPlugin) Funcs() template.FuncMap

func (*WeatherPlugin) Name

func (plugin *WeatherPlugin) Name() string

func (*WeatherPlugin) Weather

func (plugin *WeatherPlugin) Weather(location string) *WeatherResult

type WeatherResult

type WeatherResult struct {
	Code       string `json:"code"`
	UpdateTime string `json:"updateTime"`
	FxLink     string `json:"fxLink"`
	Now        struct {
		ObsTime   string `json:"obsTime"`
		Temp      string `json:"temp"`
		FeelsLike string `json:"feelsLike"`
		Icon      string `json:"icon"`
		Text      string `json:"text"`
		Wind360   string `json:"wind360"`
		WindDir   string `json:"windDir"`
		WindScale string `json:"windScale"`
		WindSpeed string `json:"windSpeed"`
		Humidity  string `json:"humidity"`
		Precip    string `json:"precip"`
		Pressure  string `json:"pressure"`
		Vis       string `json:"vis"`
		Cloud     string `json:"cloud"`
		Dew       string `json:"dew"`
	} `json:"now"`
	Refer struct {
		Sources []string `json:"sources"`
		License []string `json:"license"`
	} `json:"refer"`
}

Jump to

Keyboard shortcuts

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