http

package
v0.2.8-beta17 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package http @Link https://gitee.com/linngc/center.gf @Copyright Copyright (c) 2022 center CLI @Author linngc @License

Index

Constants

This section is empty.

Variables

View Source
var (
	CityMap = make(map[string]WeatherCity)
)

Functions

func CheckUriTime

func CheckUriTime(url string) *monitor.HttpTime

CheckUriTime 获取请求到响应花费的时间

func CheckUriVerify

func CheckUriVerify(uris []string) map[string]bool

CheckUriVerify 检查网址是否合法

func GetCityByIp

func GetCityByIp(ip string) string

GetCityByIp 获取ip所属城市

func GetClientIp

func GetClientIp(ctx context.Context) string

GetClientIp 获取客户端IP

func GetDomain

func GetDomain(ctx context.Context) string

GetDomain 获取当前请求接口域名

func GetLocalIP

func GetLocalIP() (ip string, err error)

GetLocalIP 服务端ip

func GetReqClientIp

func GetReqClientIp(r *ghttp.Request) string

GetReqClientIp 获取客户端IP

func GetUserAgent

func GetUserAgent(ctx context.Context) string

GetUserAgent 获取user-agent

Types

type Weather

type Weather struct {
	Weatherinfo WeatherDay
}

type WeatherCity

type WeatherCity struct {
	Id       string //Id
	Pid      string //父ID
	CityCode string //城市ID
	CityName string //城市名称
}

WeatherCity 所有城市名称对应的数据

type WeatherDay

type WeatherDay struct {
	City    string //城市名称
	CityId  string //城市编号
	Temp    string
	WD      string //温度
	WS      string //
	AP      string //气压
	SD      string //湿度
	WSE     string //风速
	Time    string //时间
	IsRadar string
	Radar   string //雷达
}

WeatherDay 天气信息

Jump to

Keyboard shortcuts

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