cma

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTable = "cma"
)
View Source
const (
	Version = "1.0.2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiWeatherViewResponse

type ApiWeatherViewResponse struct {
	Msg  string `json:"msg"`
	Code int    `json:"code"`
	Data struct {
		Location struct {
			Id        string  `json:"id"`
			Name      string  `json:"name"`
			Path      string  `json:"path"`
			Longitude float64 `json:"longitude"`
			Latitude  float64 `json:"latitude"`
			Timezone  int     `json:"timezone"`
		} `json:"location"`
		Daily []struct {
			Date               string  `json:"date"`
			High               float64 `json:"high"`
			DayText            string  `json:"dayText"`
			DayCode            float64 `json:"dayCode"`
			DayWindDirection   string  `json:"dayWindDirection"`
			DayWindScale       string  `json:"dayWindScale"`
			Low                float64 `json:"low"`
			NightText          string  `json:"nightText"`
			NightCode          float64 `json:"nightCode"`
			NightWindDirection string  `json:"nightWindDirection"`
			NightWindScale     string  `json:"nightWindScale"`
		} `json:"daily"`
		Now struct {
			Precipitation       float64 `json:"precipitation"`
			Temperature         float64 `json:"temperature"`
			Pressure            float64 `json:"pressure"`
			Humidity            float64 `json:"humidity"`
			WindDirection       string  `json:"windDirection"`
			WindDirectionDegree float64 `json:"windDirectionDegree"`
			WindSpeed           float64 `json:"windSpeed"`
			WindScale           string  `json:"windScale"`
		} `json:"now"`
		Alarm      []interface{} `json:"alarm"`
		LastUpdate string        `json:"lastUpdate"`
	} `json:"data"`
}

type ApiWeatherViewResult

type ApiWeatherViewResult struct {
	Result ApiWeatherViewResponse // 结果
	Body   []byte                 // 内容
	Http   gorequest.Response     // 请求
}

type Client

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

func NewClient

func NewClient() (*Client, error)

func (*Client) ApiWeatherView

func (c *Client) ApiWeatherView(ctx context.Context, stationid string, notMustParams ...gorequest.Params) (*ApiWeatherViewResult, error)

func (*Client) SetClientIP

func (c *Client) SetClientIP(clientIP string) *Client

SetClientIP 配置

func (*Client) SetLogFun

func (c *Client) SetLogFun(logFun gorequest.LogFunc)

SetLogFun 设置日志记录函数

Jump to

Keyboard shortcuts

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