gaode

package
v0.0.0-...-8f6bda2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(e error)

func Log

func Log(agrs ...interface{})

日志输出

Types

type AppGaode

type AppGaode struct {
	//数据库连接配置
	DbConfig struct {
		Hostname string
		Database string
		Username string
		Password string
		Charset  string
		Port     string
		Prefix   string
	}
	//数据库连接
	Db *gorm.DB

	Startdate string //运行开始时间
	Stopdate  string //运行截止时间
	Ranks     int    //仅获取前 n 名城市排名的数据
	Intervals int    //获取间隔时间(s)秒
}

主应用

func NewApp

func NewApp(cfg string) *AppGaode

获取应用

func ReadConfig

func ReadConfig(cfg string) *AppGaode

读取配置

func (*AppGaode) Init

func (app *AppGaode) Init()

初始化应用

func (*AppGaode) Run

func (app *AppGaode) Run()

运行任务

type GaodeGetsData

type GaodeGetsData struct {
	City          string //城市名称
	Idx           string //拥堵指数
	RealSpeed     string //平均行车速度(km/h)
	FreeFlowSpeed string //畅通行车速度(km/h)
	Value         int    //城市排名
}

func Gets

func Gets(ranks int) []*GaodeGetsData

执行一次获取

Directories

Path Synopsis
config
ini

Jump to

Keyboard shortcuts

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