├── CHANGES.md ├── geojson ├── global.geojson ├── jiangsu.geojson ├── china.geojson └── nanjing.geojson ├── go.mod ├── tile.go ├── README-EN.md ├── README.md ├── map.go ├── conf.toml ├── utils.go ├── main.go ├── task.go └── go.sum /CHANGES.md: -------------------------------------------------------------------------------- 1 | ### 变更说明 2 | 3 | #### 2022-10-01 4 | 5 | - 添加 `timedelay` 限速参数 6 | > 最小延迟时间`timedelay`,单位`ms`,用于请求限速,最准确的控制是将`works`设置为`1`,限速是为最准确最小间隔,若`works > 1`则`timedelay`只是个调和参数 -------------------------------------------------------------------------------- /geojson/global.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "name": "全球", 4 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 5 | "features": [ 6 | { "type": "Feature", "properties": { }, "geometry": { "type": "Polygon", "coordinates": [ 7 | [ [ -179.999999, -84.999999 ], [ -179.999999, 84.999999 ], [ 179.999999,84.999999 ], [ 179.999999,-84.999999 ], [ -179.999999,-84.999999 ]] 8 | ] } 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module tiler 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/antonfisher/nested-logrus-formatter v1.3.0 7 | github.com/mattn/go-runewidth v0.0.9 // indirect 8 | github.com/mattn/go-sqlite3 v1.14.19 9 | github.com/paulmach/orb v0.1.6 10 | github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 11 | github.com/sirupsen/logrus v1.6.0 12 | github.com/spf13/viper v1.7.1 13 | github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 14 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect 15 | gopkg.in/cheggaaa/pb.v1 v1.0.28 16 | ) 17 | 18 | replace github.com/paulmach/orb v0.1.6 => github.com/atlasdatatech/orb v0.2.2 19 | -------------------------------------------------------------------------------- /tile.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "math" 5 | "sync" 6 | 7 | "github.com/paulmach/orb" 8 | 9 | "github.com/paulmach/orb/maptile" 10 | ) 11 | 12 | //TileSize 默认瓦片大小 13 | const TileSize = 256 14 | 15 | //ZoomMin 最小级别 16 | const ZoomMin = 0 17 | 18 | //ZoomMax 最大级别 19 | const ZoomMax = 20 20 | 21 | //Tile 自定义瓦片存储 22 | type Tile struct { 23 | T maptile.Tile 24 | C []byte 25 | } 26 | 27 | func (tile Tile) flipY() uint32 { 28 | zpower := math.Pow(2.0, float64(tile.T.Z)) 29 | return uint32(zpower) - 1 - tile.T.Y 30 | } 31 | 32 | //Set a safety set 33 | type Set struct { 34 | sync.RWMutex 35 | M maptile.Set 36 | } 37 | 38 | //Layer 级别&瓦片数 39 | type Layer struct { 40 | URL string 41 | Zoom int 42 | Count int64 43 | Collection orb.Collection 44 | } 45 | 46 | // Constants representing TileFormat types 47 | const ( 48 | GZIP string = "gzip" // encoding = gzip 49 | ZLIB = "zlib" // encoding = deflate 50 | PNG = "png" 51 | JPG = "jpg" 52 | PBF = "pbf" 53 | WEBP = "webp" 54 | ) 55 | -------------------------------------------------------------------------------- /README-EN.md: -------------------------------------------------------------------------------- 1 | # Tiler - map tiles downloader 2 | A well-polished tile downloader 3 | 4 | Tiler is a fast map downloading framework that supports Google, Baidu, Gaode, Tiantu, Mapbox, OSM, Siwei, Yitutong, etc. 5 | - Support multi-task and multi-thread configuration, can be set arbitrarily 6 | - Support different download ranges at different levels to speed up downloads 7 | - Support precise download of contours and contour cutting 8 | - Support vector tile data download 9 | - Support file and MBTILES two storage methods 10 | - Support custom tile address 11 | 12 | ## How to use 13 | 14 | 1. Download the source code and compile it yourself on the corresponding platform 15 | 2. Directly release the release page, download the pre-compiled program for the corresponding platform 16 | 17 | Refer to the example url in the configuration file and change it to the address of the map you want to download, then start the download task~ 18 | 19 | > For example: url = "http://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", the xyz of the tile in the address uses {x}{y} {z} instead, the others remain unchanged. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # 地图下载器 Tiler - map tiles downloader 3 | 4 | A well-polished tile downloader 5 | 6 | 一个极速地图下载框架,支持谷歌、百度、高德、天地图、Mapbox、OSM、四维、易图通等。 7 | 8 | - 支持多任务多线程配置,可任意设置 9 | 10 | - 支持不同层级设置不同下载范围,以加速下载 11 | 12 | - 支持轮廓精准下载,支持轮廓裁剪 13 | 14 | - 支持矢量瓦片数据下载 15 | 16 | - 支持文件和MBTILES两种存储方式 17 | 18 | - 支持自定义瓦片地址 19 | 20 | ## 使用方式 21 | 22 | 1. 下载源代码在对应的平台上自己编译 23 | 24 | 2. 直接release发布页面, 下载对应平台的预编译程序 25 | 26 | 参照配置文件中的示例url更改为想要下载的地图地址,即可启动下载任务~ 27 | > 例如: url = "http://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}" ,地址中瓦片的xyz使用{x}{y}{z}代替,其他保持不变。 28 | 29 | ## 谷歌地图说明 30 | - 影像层 31 | 谷歌影像,分有偏移和无偏移两种,下载国内有偏移的影像需要在连接中加地区字段,如下为大陆地区偏移影像 32 | > url = "http://mt0.google.com/vt/lyrs=s&gl=CN&x={x}&y={y}&z={z}" 33 | - 标注层 34 | 影像标注,中文标注只有火星坐标,谷歌并不提供无偏移标注图层,所以通常只能下载有偏移的标注层,如下为大陆地区偏移标注 35 | > url = "http://mt0.google.com/vt/lyrs=h&gl=CN&x={x}&y={y}&z={z}" 36 | - 使用 37 | 在实际的使用中,要么保持系统的无偏移(这个时候需要校准有偏移的标注层),要么保持影像和标注的都有偏移,使用火星算法处理自己的数据 38 | 39 | #### 谷歌图层类型lyrs= 40 | - h 街道图,透明街道+标注 41 | - m 街道图 42 | - p 街道图 43 | - r 街道图 44 | - s 影像无标注 45 | - t 地形图 46 | - y 影像含标注 47 | 48 | 49 | ## 天地图说明 50 | - 天地图影像,img_w 51 | > url = "https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=75f0434f240669f4a2df6359275146d2" 52 | - 影像标注层,cia_w 53 | > url = "https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=75f0434f240669f4a2df6359275146d2" 54 | 55 | - 天地图矢量(地形图),vec_w 56 | > url = "https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=75f0434f240669f4a2df6359275146d2" 57 | - 矢量标注层,cva_w 58 | > url = "https://t0.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=75f0434f240669f4a2df6359275146d2" 59 | 60 | > 工具已经处理了天地图429限制,请合理使用!!! -------------------------------------------------------------------------------- /map.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | "strings" 7 | 8 | "github.com/paulmach/orb/maptile" 9 | ) 10 | 11 | // TileMap 瓦片地图类型 12 | type TileMap struct { 13 | ID int 14 | Name string 15 | Description string 16 | Schema string //no types,maybe "xyz" or "tms" 17 | Min int 18 | Max int 19 | Format string 20 | JSON string 21 | URL string 22 | Token string 23 | //such as porxy... 24 | } 25 | 26 | // CreateTileMap 添加地图 27 | func CreateTileMap(url string) { 28 | // tileMap := TileMap{} 29 | //tileMap.Save() 30 | //成功默认保存到数据库 31 | } 32 | 33 | // GetTileMapList 获取初始化默认地图列表 34 | func GetTileMapList() map[int]TileMap { 35 | tml := make(map[int]TileMap) 36 | var list = []string{"http://mt0.google.com/vt/lyrs=y&x={x}&y={y}&z={z}", 37 | "http://tile.openstreetmap.org/{z}/{x}/{y}.png", 38 | "http://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiYWVyb3Zpc2lvbmtlc3RyZWwiLCJhIjoiY2l5bDhzYTVqMDAxNDJ3bGp1ZHA2cmtiaCJ9.8o3pqTWKiOV8RhjNGFW0rg", 39 | // "http://mt0.google.cn/vt/lyrs=s&hl=zh-CN&x=214130&y=114212&z=18", 40 | "http://mt0.google.cn/vt/lyrs=y&hl=zh-CN&x={x}&y={y}&z={z}", 41 | "http://mt0.google.cn/vt/lyrs=s&x={x}&y={y}&z={z}", 42 | "http://mt0.google.cn/vt/lyrs=y@258000000&hl=zh-CN&gl=CN&src=app&x=214130&y=114212&z=18&s=Ga", //m:路线图,t:地形图,p:带标签的地形图,s:卫星图,y:带标签的卫星图,h:标签层(路名、地名等) 43 | } 44 | for i, v := range list { 45 | fmt.Println(i, v) 46 | m := TileMap{} 47 | tml[i] = m 48 | } 49 | return tml 50 | } 51 | 52 | // TileURL 获取瓦片URL 53 | func (m TileMap) getTileURL(t maptile.Tile) string { 54 | url := strings.Replace(m.URL, "{x}", strconv.Itoa(int(t.X)), -1) 55 | url = strings.Replace(url, "{y}", strconv.Itoa(int(t.Y)), -1) 56 | url = strings.Replace(url, "{z}", strconv.Itoa(int(t.Z)), -1) 57 | return url 58 | } 59 | -------------------------------------------------------------------------------- /conf.toml: -------------------------------------------------------------------------------- 1 | [app] 2 | version = "v 0.1.0" 3 | title = "MapCloud Tiler" 4 | [output] 5 | #can be mbtiles/file 6 | format ="file" 7 | #the output dir 8 | directory ="output" 9 | [task] 10 | #number of fetchers 11 | workers = 3 12 | #number of savers 13 | savepipe = 1 14 | #min request interval, a speed limit, unit millisecond 15 | timedelay = 50 16 | 17 | [tm] 18 | #name for mbtiles 19 | name = "google satelite" 20 | #max and min level for mbtiles 21 | min = 0 22 | max = 11 23 | #can be pbf/png/jpg 24 | format = "jpg" 25 | #can be xyz/tm 26 | schema = "xyz" 27 | #the vector tiles metadata tilejson 28 | # json = "" 29 | #url is the schema url of tiles 30 | # url = "https://api.mapbox.com/v4/mapbox.mapbox-streets-v8/{z}/{x}/{y}.vector.pbf?sku=1016gFniej06a&access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA" 31 | # url = "https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/{z}/{x}/{y}.vector.pbf?sku=1016gFniej06a&access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA" 32 | # url = "https://api.maptiler.com/tiles/v3/{z}/{x}/{y}.pbf?key=KDhMfHvorAFkFe64wlZb" 33 | # url = "http://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}" 34 | # url = "https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=75f0434f240669f4a2df6359275146d2" 35 | url = "https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=75f0434f240669f4a2df6359275146d2" 36 | #lrs can set diff boundaries for diff levels 37 | [[lrs]] 38 | min = 0 39 | max = 5 40 | geojson = "./geojson/global.geojson" 41 | [[lrs]] 42 | min = 6 43 | max = 8 44 | geojson = "./geojson/china.geojson" 45 | [[lrs]] 46 | min = 9 47 | max = 10 48 | geojson = "./geojson/jiangsu.geojson" 49 | [[lrs]] 50 | min = 11 51 | max = 11 52 | geojson = "./geojson/nanjing.geojson" -------------------------------------------------------------------------------- /geojson/jiangsu.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "name": "江苏省", 4 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 5 | "features": [ 6 | { "type": "Feature", "properties": { "ASCRIPTION": "", "CNAME": "江苏省", "GB": "320000", "area": 102017.11, "cname": "江苏省", "country": "中国", "ename": "Jiangsu Sheng", "gbcode": 156320000, "lat": "33.6022", "lng": "118.969", "population": 78660941, "province": "江苏省", "region": "华东地区", "summarize": "  江苏简称苏,位于我国大陆东部沿海中心、介于东经116°18′-121°57′,北纬30°45′-35°20′之间。跨长江下游两岸,东濒黄海,东南与浙江和上海毗邻,西连安徽,北接山东。" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 121.82104, 31.68764 ], [ 121.31541, 31.88291 ], [ 121.10172, 31.7186 ], [ 121.33097, 31.50812 ], [ 121.17322, 31.45244 ], [ 121.07345, 31.16125 ], [ 120.87895, 31.1392 ], [ 120.89615, 31.01923 ], [ 120.49975, 30.76034 ], [ 120.36609, 30.95234 ], [ 120.13727, 30.94329 ], [ 119.89559, 31.17141 ], [ 119.61895, 31.13252 ], [ 119.14475, 31.27903 ], [ 118.79078, 31.23138 ], [ 118.7159, 31.32438 ], [ 118.87694, 31.44701 ], [ 118.86373, 31.61348 ], [ 118.63864, 31.65212 ], [ 118.37962, 32.05995 ], [ 118.49157, 32.18059 ], [ 118.6716, 32.2531 ], [ 118.68767, 32.46777 ], [ 118.81939, 32.6046 ], [ 119.06904, 32.45635 ], [ 119.2145, 32.5818 ], [ 119.17952, 32.82744 ], [ 119.01547, 32.95758 ], [ 118.84418, 32.95857 ], [ 118.70184, 32.72695 ], [ 118.36982, 32.72079 ], [ 118.22763, 32.91809 ], [ 118.20616, 33.20071 ], [ 118.06345, 33.14148 ], [ 117.97766, 33.29807 ], [ 118.15969, 33.73456 ], [ 117.73006, 33.75596 ], [ 117.61564, 34.01816 ], [ 117.34718, 34.08961 ], [ 117.18697, 34.07001 ], [ 117.04132, 34.15262 ], [ 116.96388, 34.39014 ], [ 116.8268, 34.39282 ], [ 116.36721, 34.64327 ], [ 116.43711, 34.88838 ], [ 116.85583, 34.93513 ], [ 117.07311, 34.69807 ], [ 117.16705, 34.43482 ], [ 117.3961, 34.57038 ], [ 117.58663, 34.46354 ], [ 117.79374, 34.64823 ], [ 117.94617, 34.67958 ], [ 118.17901, 34.5452 ], [ 118.16473, 34.38244 ], [ 118.39929, 34.42873 ], [ 118.45533, 34.66185 ], [ 118.74032, 34.69646 ], [ 118.92082, 35.05216 ], [ 119.29752, 35.08415 ], [ 119.21455, 35.04162 ], [ 119.19354, 34.83244 ], [ 119.78071, 34.46662 ], [ 120.00897, 34.42531 ], [ 120.27672, 34.29573 ], [ 120.32001, 34.11625 ], [ 120.566, 33.68902 ], [ 120.83461, 33.1652 ], [ 121.00453, 32.57739 ], [ 121.37195, 32.42497 ], [ 121.41238, 32.17595 ], [ 121.82522, 31.95972 ], [ 121.92461, 31.76615 ], [ 121.82104, 31.68764 ] ] ] ] } } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "encoding/json" 6 | "fmt" 7 | "os" 8 | "path/filepath" 9 | "sync" 10 | 11 | "github.com/paulmach/orb" 12 | "github.com/paulmach/orb/geojson" 13 | "github.com/paulmach/orb/maptile" 14 | "github.com/paulmach/orb/maptile/tilecover" 15 | log "github.com/sirupsen/logrus" 16 | ) 17 | 18 | func saveToMBTile(tile Tile, db *sql.DB) error { 19 | _, err := db.Exec("insert into tiles (zoom_level, tile_column, tile_row, tile_data) values (?, ?, ?, ?);", tile.T.Z, tile.T.X, tile.flipY(), tile.C) 20 | // _, err := db.Exec("insert or ignore into tiles (zoom_level, tile_column, tile_row, tile_data) values (?, ?, ?, ?);", tile.T.Z, tile.T.X, tile.flipY(), tile.C) 21 | if err != nil { 22 | return err 23 | } 24 | return nil 25 | } 26 | 27 | func saveToFiles(tile Tile, task *Task) error { 28 | dir := filepath.Join(task.File, fmt.Sprintf(`%d`, tile.T.Z), fmt.Sprintf(`%d`, tile.T.X)) 29 | os.MkdirAll(dir, os.ModePerm) 30 | fileName := filepath.Join(dir, fmt.Sprintf(`%d.%s`, tile.T.Y, task.TileMap.Format)) 31 | err := os.WriteFile(fileName, tile.C, os.ModePerm) 32 | if err != nil { 33 | return err 34 | } 35 | log.Println(fileName) 36 | return nil 37 | } 38 | 39 | func optimizeConnection(db *sql.DB) error { 40 | // _, err := db.Exec("PRAGMA synchronous=0") 41 | // if err != nil { 42 | // return err 43 | // } 44 | _, err := db.Exec("PRAGMA locking_mode=EXCLUSIVE") 45 | if err != nil { 46 | return err 47 | } 48 | _, err = db.Exec("PRAGMA journal_mode=DELETE") 49 | if err != nil { 50 | return err 51 | } 52 | return nil 53 | } 54 | 55 | func optimizeDatabase(db *sql.DB) error { 56 | _, err := db.Exec("ANALYZE;") 57 | if err != nil { 58 | return err 59 | } 60 | 61 | _, err = db.Exec("VACUUM;") 62 | if err != nil { 63 | return err 64 | } 65 | 66 | return nil 67 | } 68 | 69 | func loadFeature(path string) *geojson.Feature { 70 | data, err := os.ReadFile(path) 71 | if err != nil { 72 | log.Fatalf("unable to read file: %v", err) 73 | } 74 | 75 | f, err := geojson.UnmarshalFeature(data) 76 | if err == nil { 77 | return f 78 | } 79 | 80 | fc, err := geojson.UnmarshalFeatureCollection(data) 81 | if err == nil { 82 | if len(fc.Features) != 1 { 83 | log.Fatalf("must have 1 feature: %v", len(fc.Features)) 84 | } 85 | return fc.Features[0] 86 | } 87 | 88 | g, err := geojson.UnmarshalGeometry(data) 89 | if err != nil { 90 | log.Fatalf("unable to unmarshal feature: %v", err) 91 | } 92 | 93 | return geojson.NewFeature(g.Geometry()) 94 | } 95 | 96 | func loadFeatureCollection(path string) *geojson.FeatureCollection { 97 | data, err := os.ReadFile(path) 98 | if err != nil { 99 | log.Fatalf("unable to read file: %v", err) 100 | } 101 | 102 | fc, err := geojson.UnmarshalFeatureCollection(data) 103 | if err != nil { 104 | log.Fatalf("unable to unmarshal feature: %v", err) 105 | } 106 | 107 | count := 0 108 | for i := range fc.Features { 109 | if fc.Features[i].Properties["name"] != "original" { 110 | fc.Features[count] = fc.Features[i] 111 | count++ 112 | } 113 | } 114 | fc.Features = fc.Features[:count] 115 | 116 | return fc 117 | } 118 | 119 | func loadCollection(path string) orb.Collection { 120 | data, err := os.ReadFile(path) 121 | if err != nil { 122 | log.Fatalf("unable to read file: %v", err) 123 | } 124 | 125 | fc, err := geojson.UnmarshalFeatureCollection(data) 126 | if err != nil { 127 | log.Fatalf("unable to unmarshal feature: %v", err) 128 | } 129 | 130 | var collection orb.Collection 131 | for _, f := range fc.Features { 132 | collection = append(collection, f.Geometry) 133 | } 134 | 135 | return collection 136 | } 137 | 138 | // output gets called if there is a test failure for debugging. 139 | func output(name string, r *geojson.FeatureCollection) { 140 | f := loadFeature("./data/" + name + ".geojson") 141 | if f.Properties == nil { 142 | f.Properties = make(geojson.Properties) 143 | } 144 | 145 | f.Properties["fill"] = "#FF0000" 146 | f.Properties["fill-opacity"] = "0.5" 147 | f.Properties["stroke"] = "#FF0000" 148 | f.Properties["name"] = "original" 149 | r.Append(f) 150 | 151 | data, err := json.MarshalIndent(r, "", " ") 152 | if err != nil { 153 | log.Fatalf("error marshalling json: %v", err) 154 | } 155 | 156 | err = os.WriteFile("failure_"+name+".geojson", data, 0644) 157 | if err != nil { 158 | log.Fatalf("write file failure: %v", err) 159 | } 160 | } 161 | 162 | // output gets called if there is a test failure for debugging. 163 | func output2(name string, r *geojson.FeatureCollection, wg *sync.WaitGroup) { 164 | defer wg.Done() 165 | data, err := json.MarshalIndent(r, "", " ") 166 | if err != nil { 167 | log.Fatalf("error marshalling json: %v", err) 168 | } 169 | 170 | err = os.WriteFile(name+".geojson", data, 0644) 171 | if err != nil { 172 | log.Fatalf("write file failure: %v", err) 173 | } 174 | } 175 | 176 | func getZoomCount(g orb.Geometry, minz int, maxz int) map[int]int64 { 177 | 178 | info := make(map[int]int64) 179 | for z := minz; z <= maxz; z++ { 180 | info[z] = tilecover.GeometryCount(g, maptile.Zoom(z)) 181 | } 182 | return info 183 | } 184 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "flag" 6 | "fmt" 7 | "os" 8 | "time" 9 | 10 | "github.com/shiena/ansicolor" 11 | log "github.com/sirupsen/logrus" 12 | 13 | nested "github.com/antonfisher/nested-logrus-formatter" 14 | _ "github.com/mattn/go-sqlite3" 15 | "github.com/spf13/viper" 16 | ) 17 | 18 | // flag 19 | var ( 20 | hf bool 21 | cf string 22 | ) 23 | 24 | func init() { 25 | flag.BoolVar(&hf, "h", false, "this help") 26 | flag.StringVar(&cf, "c", "conf.toml", "set config `file`") 27 | // 改变默认的 Usage,flag包中的Usage 其实是一个函数类型。这里是覆盖默认函数实现,具体见后面Usage部分的分析 28 | flag.Usage = usage 29 | //InitLog 初始化日志 30 | log.SetFormatter(&nested.Formatter{ 31 | HideKeys: true, 32 | ShowFullLevel: true, 33 | TimestampFormat: "2006-01-02 15:04:05.000", 34 | // FieldsOrder: []string{"component", "category"}, 35 | }) 36 | // then wrap the log output with it 37 | log.SetOutput(ansicolor.NewAnsiColorWriter(os.Stdout)) 38 | log.SetLevel(log.DebugLevel) 39 | } 40 | func usage() { 41 | fmt.Fprintf(os.Stderr, `tiler version: tiler/v0.1.0 42 | Usage: tiler [-h] [-c filename] 43 | `) 44 | flag.PrintDefaults() 45 | } 46 | 47 | // initConf 初始化配置 48 | func initConf(cfgFile string) { 49 | if _, err := os.Stat(cfgFile); os.IsNotExist(err) { 50 | log.Warnf("config file(%s) not exist", cfgFile) 51 | } 52 | viper.SetConfigType("toml") 53 | viper.SetConfigFile(cfgFile) 54 | viper.AutomaticEnv() // read in environment variables that match 55 | err := viper.ReadInConfig() 56 | if err != nil { 57 | log.Warnf("read config file(%s) error, details: %s", viper.ConfigFileUsed(), err) 58 | } 59 | viper.SetDefault("app.version", "v 0.1.0") 60 | viper.SetDefault("app.title", "MapCloud Tiler") 61 | viper.SetDefault("output.format", "mbtiles") 62 | viper.SetDefault("output.directory", "output") 63 | viper.SetDefault("task.workers", 4) 64 | viper.SetDefault("task.savepipe", 1) 65 | viper.SetDefault("task.timedelay", 0) 66 | } 67 | 68 | type TileData struct { 69 | Z int 70 | X int 71 | Y int 72 | Flag bool 73 | } 74 | 75 | // 插入瓦片数据 76 | func insertTiles(db *sql.Tx, tiles []TileData) error { 77 | // 准备插入语句 78 | stmt, err := db.Prepare("INSERT INTO tiles (z, x, y,flag) VALUES (?, ?, ?, ?)") 79 | if err != nil { 80 | return err 81 | } 82 | defer stmt.Close() 83 | 84 | // 执行插入 85 | for _, tile := range tiles { 86 | _, err = stmt.Exec(tile.Z, tile.X, tile.Y, tile.Flag) 87 | if err != nil { 88 | return err 89 | } 90 | } 91 | return nil 92 | } 93 | 94 | func testDbTask() { 95 | 96 | db, err := sql.Open("sqlite3", "./tiles.db") 97 | if err != nil { 98 | log.Fatal(err) 99 | } 100 | defer db.Close() 101 | 102 | createTableSQL := `CREATE TABLE IF NOT EXISTS tiles ( 103 | id INTEGER PRIMARY KEY AUTOINCREMENT, 104 | z INTEGER, 105 | x INTEGER, 106 | y INTEGER, 107 | flag BOOLEAN 108 | );` 109 | 110 | _, err = db.Exec(createTableSQL) 111 | if err != nil { 112 | log.Fatal(err) 113 | } 114 | 115 | // 开始事务 116 | tx, err := db.Begin() 117 | if err != nil { 118 | log.Fatal(err) 119 | } 120 | defer tx.Rollback() // 如果提交事务前发生错误,则回滚事务 121 | 122 | batchSize := 1 << 10 123 | // 插入数据 124 | tileBatch := make([]TileData, 0, batchSize) 125 | total := 0 126 | i := 0 127 | for z := 0; z <= 12; z++ { 128 | numTiles := 1 << uint(z) // 计算每个缩放级别的瓦片数量 129 | total += numTiles * numTiles 130 | log.Printf("级别%d,瓦片数量:%d\n", z, numTiles*numTiles) 131 | log.Printf("总瓦片数量:%d\n", total) 132 | for x := 0; x < numTiles; x++ { 133 | for y := 0; y < numTiles; y++ { 134 | tile := TileData{Z: z, X: x, Y: y, Flag: false} 135 | tileBatch = append(tileBatch, tile) 136 | // 批量插入 137 | if len(tileBatch) >= batchSize { 138 | err := insertTiles(tx, tileBatch) // 使用事务执行批量插入操作 139 | if err != nil { 140 | log.Fatal(err) 141 | } 142 | tileBatch = nil // 清空批次 143 | } 144 | i++ 145 | if i > 99999999 { 146 | goto last 147 | } 148 | } 149 | 150 | } 151 | } 152 | last: 153 | // 处理剩余的批次 154 | if len(tileBatch) > 0 { 155 | err := insertTiles(tx, tileBatch) // 使用事务执行批量插入操作 156 | if err != nil { 157 | log.Fatal(err) 158 | } 159 | } 160 | // 提交事务 161 | err = tx.Commit() 162 | if err != nil { 163 | log.Fatal(err) 164 | } 165 | } 166 | 167 | func main() { 168 | flag.Parse() 169 | if hf { 170 | flag.Usage() 171 | return 172 | } 173 | 174 | if cf == "" { 175 | cf = "conf.toml" 176 | } 177 | initConf(cf) 178 | start := time.Now() 179 | tm := TileMap{ 180 | Name: viper.GetString("tm.name"), 181 | Min: viper.GetInt("tm.min"), 182 | Max: viper.GetInt("tm.max"), 183 | Format: viper.GetString("tm.format"), 184 | Schema: viper.GetString("tm.schema"), 185 | JSON: viper.GetString("tm.json"), 186 | URL: viper.GetString("tm.url"), 187 | } 188 | type cfgLayer struct { 189 | Min int 190 | Max int 191 | Geojson string 192 | URL string 193 | } 194 | var cfgLrs []cfgLayer 195 | err := viper.UnmarshalKey("lrs", &cfgLrs) 196 | if err != nil { 197 | log.Fatal("lrs配置错误") 198 | } 199 | var layers []Layer 200 | for _, lrs := range cfgLrs { 201 | for z := lrs.Min; z <= lrs.Max; z++ { 202 | c := loadCollection(lrs.Geojson) 203 | layer := Layer{ 204 | URL: lrs.URL, 205 | Zoom: z, 206 | Collection: c, 207 | } 208 | layers = append(layers, layer) 209 | } 210 | } 211 | task := NewTask(layers, tm) 212 | fmt.Println(task.workerCount) 213 | task.Download() 214 | secs := time.Since(start).Seconds() 215 | log.Printf("\n%.3fs finished...", secs) 216 | } 217 | -------------------------------------------------------------------------------- /geojson/china.geojson: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "name": "china", 4 | "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, 5 | "features": [ 6 | { "type": "Feature", "properties": { "id": null, "name": "中国" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 121.905121290000011, 25.106594143000052 ], [ 121.998863220214844, 25.015911102294922 ], [ 121.80615234375, 24.831928253173828 ], [ 121.869377136230469, 24.547494888305664 ], [ 121.767425977000016, 24.300930080000057 ], [ 121.615921020507813, 24.09912109375 ], [ 121.629161004000025, 24.014960028000075 ], [ 121.46216881600003, 23.343003648000035 ], [ 121.40007571700005, 23.145493882000039 ], [ 121.299571160000028, 22.959173895000049 ], [ 121.159353061000047, 22.757473049000055 ], [ 120.970123291015625, 22.560441970825195 ], [ 120.856163024902344, 21.9093017578125 ], [ 120.727073669433594, 21.922456741333008 ], [ 120.632156372070313, 22.308504104614258 ], [ 120.2677001953125, 22.600120544433594 ], [ 120.163828972000033, 22.95384349200009 ], [ 120.054512023925781, 23.054048538208008 ], [ 120.007656285000053, 23.432593713000074 ], [ 120.547373894000089, 24.351548570000091 ], [ 120.902354363000086, 24.836818752000056 ], [ 120.926036004000025, 24.884711005000042 ], [ 121.00554446700005, 25.000677802000041 ], [ 121.031993035000028, 25.029242255000042 ], [ 121.059336785000028, 25.05023834800005 ], [ 121.51654795298569, 25.295099403836911 ], [ 121.580821160000028, 25.283026434000078 ], [ 121.905121290000011, 25.106594143000052 ] ] ], [ [ [ 110.403493686000047, 18.662787177000041 ], [ 110.156993035000028, 18.58079661700009 ], [ 110.04029381600003, 18.38226959800005 ], [ 109.708750847000033, 18.207220770000049 ], [ 109.561208530000044, 18.169338283000059 ], [ 109.47521, 18.197701 ], [ 109.162608269000032, 18.28782786700009 ], [ 108.69499759200005, 18.504828192000048 ], [ 108.677256707000026, 18.532416083000044 ], [ 108.623871290000068, 18.849188544000071 ], [ 108.615244988000029, 19.101629950000074 ], [ 108.622080925000034, 19.217718817000048 ], [ 108.631683790000068, 19.286281643000052 ], [ 108.686534050000034, 19.377875067000048 ], [ 109.015879754000025, 19.601263739000046 ], [ 109.166840040000068, 19.805487372000073 ], [ 109.261566602000073, 19.900824286000045 ], [ 109.611664259000065, 19.997870184000078 ], [ 109.719004754000025, 20.010646877000056 ], [ 109.94263756600003, 19.990912177000041 ], [ 110.156993035000028, 20.067368882000039 ], [ 110.59310957100007, 20.107326565000051 ], [ 110.677907748000052, 20.163560289000088 ], [ 110.920664910000028, 20.01203034100007 ], [ 110.977061394000032, 19.86587148600006 ], [ 111.034678582000026, 19.642238674000055 ], [ 110.666026238000029, 19.31976959800005 ], [ 110.53443444100003, 18.785630601000037 ], [ 110.403493686000047, 18.662787177000041 ] ] ], [ [ [ 127.657407, 49.76027 ], [ 129.397818, 49.4406 ], [ 130.582293, 48.729687 ], [ 130.987282, 47.790132 ], [ 132.506672, 47.78897 ], [ 133.373596, 48.183442 ], [ 135.026311, 48.47823 ], [ 134.500814, 47.57844 ], [ 134.112362, 47.212467 ], [ 133.769644, 46.116927 ], [ 133.097127, 45.144066 ], [ 131.883454, 45.321162 ], [ 131.025212, 44.967953 ], [ 131.288555, 44.11152 ], [ 131.144688, 42.92999 ], [ 130.633866, 42.903015 ], [ 130.640016, 42.395009 ], [ 129.994267, 42.985387 ], [ 129.596669, 42.424982 ], [ 128.052215, 41.994285 ], [ 128.208433, 41.466772 ], [ 127.343783, 41.503152 ], [ 126.869083, 41.816569 ], [ 126.182045, 41.107336 ], [ 125.079942, 40.569824 ], [ 124.265625, 39.928493 ], [ 122.86757, 39.637788 ], [ 122.051280144000089, 39.06712474200009 ], [ 121.179535352000016, 38.720933335000041 ], [ 121.078398843193526, 39.241385568525359 ], [ 121.22779381600003, 39.518866278000075 ], [ 122.168595, 40.422443 ], [ 121.640359, 40.94639 ], [ 120.472015821000014, 40.21430084800005 ], [ 119.639602, 39.898056 ], [ 119.305075381000051, 39.432977787000084 ], [ 118.940196160000028, 39.138861395000049 ], [ 118.594320566000079, 38.972197399000038 ], [ 117.532702, 38.737636 ], [ 118.898245182000096, 38.123298767000051 ], [ 119.259597456000051, 37.715847412000073 ], [ 119.287119988000086, 37.137274481000077 ], [ 119.846283399000072, 37.343695380000042 ], [ 120.690196160000028, 37.990627346000053 ], [ 121.80572636544872, 37.681574737664832 ], [ 122.680430535000028, 37.415025132000039 ], [ 122.655735638445762, 36.849091429059492 ], [ 121.271184451502137, 36.603727927575811 ], [ 120.637009, 36.11144 ], [ 119.860199415000011, 35.60610586100006 ], [ 119.253507800908665, 34.897137144934874 ], [ 120.227525, 34.360332 ], [ 120.690636881027359, 33.389904207249423 ], [ 121.38940888400009, 32.384947575000069 ], [ 121.821945116000052, 31.952486444000044 ], [ 121.93038277800008, 31.726714179000055 ], [ 121.98659839600009, 31.503897262000066 ], [ 121.950820062000048, 30.982080909000047 ], [ 122.529307488000086, 30.720770575000074 ], [ 122.395192905000044, 29.833319403000075 ], [ 122.186859571000014, 29.673407294000071 ], [ 121.938428, 29.018022 ], [ 121.684439, 28.225513 ], [ 121.279144727000016, 28.085435289000088 ], [ 121.171234571000014, 27.818793036000045 ], [ 121.10336493, 27.451879507000058 ], [ 120.395473, 27.053207 ], [ 119.949961785000028, 26.364935614000046 ], [ 119.846527540000011, 25.461167710000041 ], [ 119.52898196700005, 25.165350653000075 ], [ 118.656871, 24.547391 ], [ 117.431558644, 23.582630235000067 ], [ 116.494687913, 22.939352413000051 ], [ 115.890735, 22.782873 ], [ 114.895966425000097, 22.547524404000058 ], [ 114.302500847000033, 22.044867255000042 ], [ 114.222422722000033, 22.021673895000049 ], [ 113.764476783000077, 21.966817927000079 ], [ 113.258474155000044, 21.880438544000071 ], [ 112.790212436000047, 21.57758209800005 ], [ 111.843592, 21.550494 ], [ 110.852305535000028, 21.389146226000037 ], [ 110.534190300000034, 20.478257554000038 ], [ 110.444039, 20.341033 ], [ 110.399994337000066, 20.300767320000091 ], [ 110.280284050000034, 20.252997137000079 ], [ 109.924896681000064, 20.238267320000091 ], [ 109.627655, 21.008227 ], [ 109.765716993000069, 21.355943101000037 ], [ 109.708588087000066, 21.483303127000056 ], [ 109.156260613000029, 21.40375397300005 ], [ 108.74537194100003, 21.60297272300005 ], [ 108.470957879000025, 21.561997789000088 ], [ 108.211029493000069, 21.50063711100006 ], [ 108.05018, 21.55238 ], [ 107.04342, 21.811899 ], [ 106.567273, 22.218205 ], [ 106.725403, 22.794268 ], [ 105.811247, 22.976892 ], [ 105.329209, 23.352063 ], [ 104.476858, 22.81915 ], [ 103.504515, 22.703757 ], [ 102.706992, 22.708795 ], [ 102.170436, 22.464753 ], [ 101.652018, 22.318199 ], [ 101.80312, 21.174367 ], [ 101.270026, 21.201652 ], [ 101.180005, 21.436573 ], [ 101.150033, 21.849984 ], [ 100.416538, 21.558839 ], [ 99.983489, 21.742937 ], [ 99.240899, 22.118314 ], [ 99.531992, 22.949039 ], [ 98.898749, 23.142722 ], [ 98.660262, 24.063286 ], [ 97.60472, 23.897405 ], [ 97.724609, 25.083637 ], [ 98.671838, 25.918703 ], [ 98.712094, 26.743536 ], [ 98.68269, 27.508812 ], [ 98.246231, 27.747221 ], [ 97.911988, 28.335945 ], [ 97.327114, 28.261583 ], [ 96.248833, 28.411031 ], [ 96.586591, 28.83098 ], [ 96.117679, 29.452802 ], [ 95.404802, 29.031717 ], [ 94.56599, 29.277438 ], [ 93.413348, 28.640629 ], [ 92.503119, 27.896876 ], [ 91.696657, 27.771742 ], [ 91.258854, 28.040614 ], [ 90.730514, 28.064954 ], [ 90.015829, 28.296439 ], [ 89.47581, 28.042759 ], [ 88.814248, 27.299316 ], [ 88.730326, 28.086865 ], [ 88.120441, 27.876542 ], [ 86.954517, 27.974262 ], [ 85.82332, 28.203576 ], [ 85.011638, 28.642774 ], [ 84.23458, 28.839894 ], [ 83.898993, 29.320226 ], [ 83.337115, 29.463732 ], [ 82.327513, 30.115268 ], [ 81.525804, 30.422717 ], [ 81.111256, 30.183481 ], [ 79.721367, 30.882715 ], [ 78.738894, 31.515906 ], [ 78.458446, 32.618164 ], [ 79.176129, 32.48378 ], [ 79.208892, 32.994395 ], [ 78.811086, 33.506198 ], [ 78.912269, 34.321936 ], [ 77.837451, 35.49401 ], [ 76.192848, 35.898403 ], [ 75.896897, 36.666806 ], [ 75.158028, 37.133031 ], [ 74.980002, 37.41999 ], [ 74.829986, 37.990007 ], [ 74.864816, 38.378846 ], [ 74.257514, 38.606507 ], [ 73.928852, 38.505815 ], [ 73.675379, 39.431237 ], [ 73.960013, 39.660008 ], [ 73.822244, 39.893973 ], [ 74.776862, 40.366425 ], [ 75.467828, 40.562072 ], [ 76.526368, 40.427946 ], [ 76.904484, 41.066486 ], [ 78.187197, 41.185316 ], [ 78.543661, 41.582243 ], [ 80.11943, 42.123941 ], [ 80.25999, 42.349999 ], [ 80.18015, 42.920068 ], [ 80.866206, 43.180362 ], [ 79.966106, 44.917517 ], [ 81.947071, 45.317027 ], [ 82.458926, 45.53965 ], [ 83.180484, 47.330031 ], [ 85.16429, 47.000956 ], [ 85.720484, 47.452969 ], [ 85.768233, 48.455751 ], [ 86.598776, 48.549182 ], [ 87.35997, 49.214981 ], [ 87.751264, 49.297198 ], [ 88.013832, 48.599463 ], [ 88.854298, 48.069082 ], [ 90.280826, 47.693549 ], [ 90.970809, 46.888146 ], [ 90.585768, 45.719716 ], [ 90.94554, 45.286073 ], [ 92.133891, 45.115076 ], [ 93.480734, 44.975472 ], [ 94.688929, 44.352332 ], [ 95.306875, 44.241331 ], [ 95.762455, 43.319449 ], [ 96.349396, 42.725635 ], [ 97.451757, 42.74889 ], [ 99.515817, 42.524691 ], [ 100.845866, 42.663804 ], [ 101.83304, 42.514873 ], [ 103.312278, 41.907468 ], [ 104.522282, 41.908347 ], [ 104.964994, 41.59741 ], [ 106.129316, 42.134328 ], [ 107.744773, 42.481516 ], [ 109.243596, 42.519446 ], [ 110.412103, 42.871234 ], [ 111.129682, 43.406834 ], [ 111.829588, 43.743118 ], [ 111.667737, 44.073176 ], [ 111.348377, 44.457442 ], [ 111.873306, 45.102079 ], [ 112.436062, 45.011646 ], [ 113.463907, 44.808893 ], [ 114.460332, 45.339817 ], [ 115.985096, 45.727235 ], [ 116.717868, 46.388202 ], [ 117.421701, 46.672733 ], [ 118.874326, 46.805412 ], [ 119.66327, 46.69268 ], [ 119.772824, 47.048059 ], [ 118.866574, 47.74706 ], [ 118.064143, 48.06673 ], [ 117.295507, 47.697709 ], [ 116.308953, 47.85341 ], [ 115.742837, 47.726545 ], [ 115.485282, 48.135383 ], [ 116.191802, 49.134598 ], [ 116.678801, 49.888531 ], [ 117.879244, 49.510983 ], [ 119.288461, 50.142883 ], [ 119.279366, 50.582908 ], [ 120.18205, 51.643566 ], [ 120.738191, 51.964115 ], [ 120.725789, 52.516226 ], [ 120.177089, 52.753886 ], [ 121.003085, 53.251401 ], [ 122.245748, 53.431726 ], [ 123.571507, 53.458804 ], [ 125.068211, 53.161045 ], [ 125.946349, 52.792799 ], [ 126.564399, 51.784255 ], [ 126.939157, 51.353894 ], [ 127.287456, 50.739797 ], [ 127.657407, 49.76027 ] ] ] ] } } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /task.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "compress/gzip" 6 | "database/sql" 7 | "fmt" 8 | "io" 9 | "math" 10 | "net/http" 11 | "os" 12 | "path/filepath" 13 | "strconv" 14 | "strings" 15 | "sync" 16 | "time" 17 | 18 | "github.com/paulmach/orb" 19 | "github.com/paulmach/orb/maptile" 20 | "github.com/paulmach/orb/maptile/tilecover" 21 | log "github.com/sirupsen/logrus" 22 | "github.com/spf13/viper" 23 | "github.com/teris-io/shortid" 24 | pb "gopkg.in/cheggaaa/pb.v1" 25 | ) 26 | 27 | // MBTileVersion mbtiles版本号 28 | const MBTileVersion = "1.2" 29 | 30 | // Task 下载任务 31 | type Task struct { 32 | ID string 33 | Name string 34 | Description string 35 | File string 36 | Min int 37 | Max int 38 | Layers []Layer 39 | TileMap TileMap 40 | Total int64 41 | Current int64 42 | Bar *pb.ProgressBar 43 | db *sql.DB 44 | workerCount int 45 | savePipeSize int 46 | timeDelay int 47 | bufSize int 48 | tileWG sync.WaitGroup 49 | abort, pause, play chan struct{} 50 | workers chan maptile.Tile 51 | savingpipe chan Tile 52 | tileSet Set 53 | outformat string 54 | } 55 | 56 | // NewTask 创建下载任务 57 | func NewTask(layers []Layer, m TileMap) *Task { 58 | if len(layers) == 0 { 59 | return nil 60 | } 61 | id, _ := shortid.Generate() 62 | 63 | task := Task{ 64 | ID: id, 65 | Name: m.Name, 66 | Layers: layers, 67 | Min: m.Min, 68 | Max: m.Max, 69 | TileMap: m, 70 | } 71 | 72 | for i := 0; i < len(layers); i++ { 73 | if layers[i].URL == "" { 74 | layers[i].URL = m.URL 75 | } 76 | layers[i].Count = tilecover.CollectionCount(layers[i].Collection, maptile.Zoom(layers[i].Zoom)) 77 | log.Printf("zoom: %d, tiles: %d \n", layers[i].Zoom, layers[i].Count) 78 | task.Total += layers[i].Count 79 | } 80 | task.abort = make(chan struct{}) 81 | task.pause = make(chan struct{}) 82 | task.play = make(chan struct{}) 83 | 84 | task.workerCount = viper.GetInt("task.workers") 85 | task.savePipeSize = viper.GetInt("task.savepipe") 86 | task.timeDelay = viper.GetInt("task.timedelay") 87 | task.workers = make(chan maptile.Tile, task.workerCount) 88 | task.savingpipe = make(chan Tile, task.savePipeSize) 89 | task.bufSize = viper.GetInt("task.mergebuf") 90 | task.tileSet = Set{M: make(maptile.Set)} 91 | 92 | task.outformat = viper.GetString("output.format") 93 | return &task 94 | } 95 | 96 | // Bound 范围 97 | func (task *Task) Bound() orb.Bound { 98 | bound := orb.Bound{Min: orb.Point{1, 1}, Max: orb.Point{-1, -1}} 99 | for _, layer := range task.Layers { 100 | for _, g := range layer.Collection { 101 | bound = bound.Union(g.Bound()) 102 | } 103 | } 104 | return bound 105 | } 106 | 107 | // Center 中心点 108 | func (task *Task) Center() orb.Point { 109 | layer := task.Layers[len(task.Layers)-1] 110 | bound := orb.Bound{Min: orb.Point{1, 1}, Max: orb.Point{-1, -1}} 111 | for _, g := range layer.Collection { 112 | bound = bound.Union(g.Bound()) 113 | } 114 | return bound.Center() 115 | } 116 | 117 | // MetaItems 输出 118 | func (task *Task) MetaItems() map[string]string { 119 | b := task.Bound() 120 | c := task.Center() 121 | data := map[string]string{ 122 | "id": task.ID, 123 | "name": task.Name, 124 | "description": task.Description, 125 | "attribution": `© MapCloud`, 126 | "basename": task.TileMap.Name, 127 | "format": task.TileMap.Format, 128 | "type": task.TileMap.Schema, 129 | "pixel_scale": strconv.Itoa(TileSize), 130 | "version": MBTileVersion, 131 | "bounds": fmt.Sprintf(`%f,%f,%f,%f`, b.Left(), b.Bottom(), b.Right(), b.Top()), 132 | "center": fmt.Sprintf(`%f,%f,%d`, c.X(), c.Y(), (task.Min+task.Max)/2), 133 | "minzoom": strconv.Itoa(task.Min), 134 | "maxzoom": strconv.Itoa(task.Max), 135 | "json": task.TileMap.JSON, 136 | } 137 | return data 138 | } 139 | 140 | // SetupMBTileTables 初始化配置MBTile库 141 | func (task *Task) SetupMBTileTables() error { 142 | 143 | if task.File == "" { 144 | outdir := viper.GetString("output.directory") 145 | os.MkdirAll(outdir, os.ModePerm) 146 | task.File = filepath.Join(outdir, fmt.Sprintf("%s-z%d-%d.%s.mbtiles", task.Name, task.Min, task.Max, task.ID)) 147 | } 148 | os.Remove(task.File) 149 | db, err := sql.Open("sqlite3", task.File) 150 | if err != nil { 151 | return err 152 | } 153 | 154 | err = optimizeConnection(db) 155 | if err != nil { 156 | return err 157 | } 158 | 159 | _, err = db.Exec("create table if not exists tiles (zoom_level integer, tile_column integer, tile_row integer, tile_data blob);") 160 | if err != nil { 161 | return err 162 | } 163 | 164 | _, err = db.Exec("create table if not exists metadata (name text, value text);") 165 | if err != nil { 166 | return err 167 | } 168 | 169 | _, err = db.Exec("create unique index name on metadata (name);") 170 | if err != nil { 171 | return err 172 | } 173 | 174 | _, err = db.Exec("create unique index tile_index on tiles(zoom_level, tile_column, tile_row);") 175 | if err != nil { 176 | return err 177 | } 178 | 179 | // Load metadata. 180 | for name, value := range task.MetaItems() { 181 | _, err := db.Exec("insert into metadata (name, value) values (?, ?)", name, value) 182 | if err != nil { 183 | return err 184 | } 185 | } 186 | 187 | task.db = db //保存任务的库连接 188 | return nil 189 | } 190 | 191 | func (task *Task) abortFun() { 192 | // os.Stdin.Read(make([]byte, 1)) // read a single byte 193 | // <-time.After(8 * time.Second) 194 | task.abort <- struct{}{} 195 | } 196 | 197 | func (task *Task) pauseFun() { 198 | // os.Stdin.Read(make([]byte, 1)) // read a single byte 199 | // <-time.After(3 * time.Second) 200 | task.pause <- struct{}{} 201 | } 202 | 203 | func (task *Task) playFun() { 204 | // os.Stdin.Read(make([]byte, 1)) // read a single byte 205 | // <-time.After(5 * time.Second) 206 | task.play <- struct{}{} 207 | } 208 | 209 | // SavePipe 保存瓦片管道 210 | func (task *Task) savePipe() { 211 | for tile := range task.savingpipe { 212 | err := saveToMBTile(tile, task.db) 213 | if err != nil { 214 | if strings.HasPrefix(err.Error(), "UNIQUE constraint failed") { 215 | log.Warnf("save %v tile to mbtiles db error ~ %s", tile.T, err) 216 | } else { 217 | log.Errorf("save %v tile to mbtiles db error ~ %s", tile.T, err) 218 | } 219 | } 220 | } 221 | } 222 | 223 | // SaveTile 保存瓦片 224 | func (task *Task) saveTile(tile Tile) error { 225 | // defer task.wg.Done() 226 | err := saveToFiles(tile, task) 227 | if err != nil { 228 | log.Errorf("create %v tile file error ~ %s", tile.T, err) 229 | } 230 | return nil 231 | } 232 | 233 | // tileFetcher 瓦片加载器 234 | func (task *Task) tileFetcher(mt maptile.Tile, url string) { 235 | start := time.Now() 236 | defer task.tileWG.Done() //结束该瓦片请求 237 | defer func() { 238 | <-task.workers //workers完成并清退 239 | }() 240 | 241 | prep := func(t maptile.Tile, url string) string { 242 | url = strings.Replace(url, "{x}", strconv.Itoa(int(t.X)), -1) 243 | url = strings.Replace(url, "{y}", strconv.Itoa(int(t.Y)), -1) 244 | maxY := int(math.Pow(2, float64(t.Z))) - 1 245 | url = strings.Replace(url, "{-y}", strconv.Itoa(maxY-int(t.Y)), -1) 246 | url = strings.Replace(url, "{z}", strconv.Itoa(int(t.Z)), -1) 247 | return url 248 | } 249 | tile := prep(mt, url) 250 | client := &http.Client{ 251 | CheckRedirect: func(req *http.Request, via []*http.Request) error { 252 | // 自定义重定向的行为 253 | return http.ErrUseLastResponse // 使用最后一个响应 254 | }, 255 | } 256 | req, err := http.NewRequest("GET", tile, nil) 257 | if err != nil { 258 | fmt.Println("创建请求失败:", err) 259 | return 260 | } 261 | 262 | req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36") 263 | req.Header.Set("Referer", "https://map.tianditu.gov.cn") 264 | // req.Header.Set("Referer", "https://jiangsu.tianditu.gov.cn") 265 | resp, err := client.Do(req) 266 | if err != nil { 267 | fmt.Println("发送请求失败:", err) 268 | return 269 | } 270 | defer resp.Body.Close() 271 | // resp, err := http.Get(tile) 272 | // if err != nil { 273 | // log.Errorf("fetch :%s error, details: %s ~", tile, err) 274 | // return 275 | // } 276 | // defer resp.Body.Close() 277 | if resp.StatusCode != 200 { 278 | log.Errorf("fetch %v tile error, status code: %d ~", tile, resp.StatusCode) 279 | return 280 | } 281 | body, err := io.ReadAll(resp.Body) 282 | if err != nil { 283 | log.Errorf("read %v tile error ~ %s", mt, err) 284 | return 285 | } 286 | if len(body) == 0 { 287 | log.Warnf("nil tile %v ~", mt) 288 | return //zero byte tiles n 289 | } 290 | // tiledata 291 | td := Tile{ 292 | T: mt, 293 | C: body, 294 | } 295 | 296 | if task.TileMap.Format == PBF { 297 | var buf bytes.Buffer 298 | zw := gzip.NewWriter(&buf) 299 | _, err = zw.Write(body) 300 | if err != nil { 301 | log.Fatal(err) 302 | } 303 | if err := zw.Close(); err != nil { 304 | log.Fatal(err) 305 | } 306 | td.C = buf.Bytes() 307 | } 308 | 309 | //enable savingpipe 310 | if task.outformat == "mbtiles" { 311 | task.savingpipe <- td 312 | } else { 313 | // task.wg.Add(1) 314 | task.saveTile(td) 315 | } 316 | 317 | cost := time.Since(start).Milliseconds() 318 | log.Infof("tile(z:%d, x:%d, y:%d), %dms , %.2f kb, %s ...\n", mt.Z, mt.X, mt.Y, cost, float32(len(body))/1024.0, tile) 319 | } 320 | 321 | // DownloadZoom 下载指定层级 322 | func (task *Task) downloadLayer(layer Layer) { 323 | bar := pb.New64(layer.Count).Prefix(fmt.Sprintf("Zoom %d : ", layer.Zoom)).Postfix("\n") 324 | // bar.SetRefreshRate(time.Second) 325 | bar.Start() 326 | // bar.SetMaxWidth(300) 327 | 328 | var tilelist = make(chan maptile.Tile, task.bufSize) 329 | 330 | go tilecover.CollectionChannel(layer.Collection, maptile.Zoom(layer.Zoom), tilelist) 331 | 332 | for tile := range tilelist { 333 | // log.Infof(`fetching tile %v ~`, tile) 334 | select { 335 | case task.workers <- tile: 336 | //设置请求发送间隔时间 337 | time.Sleep(time.Duration(task.timeDelay) * time.Millisecond) 338 | bar.Increment() 339 | task.Bar.Increment() 340 | task.tileWG.Add(1) 341 | go task.tileFetcher(tile, layer.URL) 342 | case <-task.abort: 343 | log.Infof("Task %s got canceled.", task.ID) 344 | close(tilelist) 345 | case <-task.pause: 346 | log.Infof("Task %s suspended.", task.ID) 347 | select { 348 | case <-task.play: 349 | log.Infof("Task %s go on.", task.ID) 350 | case <-task.abort: 351 | log.Infof("Task %s got canceled.", task.ID) 352 | close(tilelist) 353 | } 354 | } 355 | } 356 | //等待该层结束 357 | task.tileWG.Wait() 358 | bar.FinishPrint(fmt.Sprintf("Task %s Zoom %d finished ~", task.ID, layer.Zoom)) 359 | } 360 | 361 | // Download 开启下载任务 362 | func (task *Task) Download() { 363 | //g orb.Geometry, minz int, maxz int 364 | task.Bar = pb.New64(task.Total).Prefix("Task : ").Postfix("\n") 365 | // task.Bar.SetRefreshRate(10 * time.Second) 366 | // task.Bar.Format("<.- >") 367 | task.Bar.Start() 368 | if task.outformat == "mbtiles" { 369 | task.SetupMBTileTables() 370 | } else { 371 | if task.File == "" { 372 | outdir := viper.GetString("output.directory") 373 | task.File = filepath.Join(outdir, fmt.Sprintf("%s-z%d-%d.%s", task.Name, task.Min, task.Max, task.ID)) 374 | } 375 | os.MkdirAll(task.File, os.ModePerm) 376 | } 377 | go task.savePipe() 378 | for _, layer := range task.Layers { 379 | task.downloadLayer(layer) 380 | } 381 | task.Bar.FinishPrint(fmt.Sprintf("Task %s finished ~", task.ID)) 382 | } 383 | -------------------------------------------------------------------------------- /geojson/nanjing.geojson: -------------------------------------------------------------------------------- 1 | {"type":"FeatureCollection","name":"南京市","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[119.13559,31.44675],[119.15879,31.442950000000003],[119.16389,31.395850000000003],[119.18478999999999,31.380950000000002],[119.20738999999999,31.346850000000003],[119.17629,31.302350000000004],[119.14479,31.279050000000005],[119.07839,31.241550000000004],[119.04359,31.235450000000004],[119.00939,31.243550000000003],[118.97919,31.23955],[118.88629,31.24025],[118.86619,31.24475],[118.79079,31.23135],[118.75709,31.27985],[118.72509000000001,31.28385],[118.71589,31.324350000000003],[118.73959,31.371050000000004],[118.76739,31.365850000000005],[118.83099,31.383350000000004],[118.84669,31.395650000000003],[118.87698999999999,31.447050000000004],[118.87558999999999,31.490050000000004],[118.91418999999999,31.448250000000005],[118.94049,31.401950000000006],[118.95459,31.394550000000006],[119.00569,31.386150000000004],[119.01279,31.416250000000005],[119.02879,31.431150000000006],[119.05739,31.433950000000006],[119.11359,31.422750000000008],[119.12799,31.438250000000007],[119.13559,31.44675000000001]]]},"properties":{"ASCRIPTION":"","CNAME":"高淳区","GB":"320118","area":786.18,"cname":"高淳区","country":"中国","ename":"Gaochun Qu","gbcode":156320118,"lat":"31.32969","lng":"118.887132","population":417129,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.97419,31.76895],[119.02439,31.786550000000002],[119.05769,31.78555],[119.11958999999999,31.737550000000002],[119.15238999999998,31.701150000000002],[119.18118999999999,31.695950000000003],[119.18698999999998,31.661750000000005],[119.20718999999998,31.629650000000005],[119.22888999999998,31.628950000000007],[119.21058999999998,31.572350000000007],[119.18378999999999,31.553650000000008],[119.17828999999999,31.502050000000008],[119.14768999999998,31.494950000000006],[119.13558999999998,31.446750000000005],[119.12798999999998,31.438250000000004],[119.11358999999999,31.422750000000004],[119.05738999999998,31.433950000000003],[119.02878999999999,31.431150000000002],[119.01278999999998,31.41625],[119.00568999999999,31.38615],[118.95458999999998,31.394550000000002],[118.94048999999998,31.401950000000003],[118.91418999999998,31.44825],[118.87558999999997,31.49005],[118.88128999999998,31.52985],[118.86368999999998,31.61345],[118.82818999999998,31.63265],[118.85878999999998,31.648950000000003],[118.88168999999999,31.64645],[118.90199,31.68635],[118.94229,31.69415],[118.93049,31.71855],[118.89799000000001,31.73425],[118.89099,31.76705],[118.90069,31.78995],[118.94819,31.76885],[118.97419,31.76895]]]},"properties":{"ASCRIPTION":"","CNAME":"溧水区","GB":"320117","area":1059.81,"cname":"溧水区","country":"中国","ename":"Lishui Qu","gbcode":156320117,"lat":"31.652895","lng":"119.023106","population":421323,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.80459,31.97785],[118.76409000000001,31.95745],[118.77099000000001,31.91975],[118.74409000000001,31.91465],[118.71199000000001,31.92875],[118.68249000000002,31.925150000000002],[118.63109000000001,31.868850000000002],[118.58879000000002,31.887950000000004],[118.58739000000001,31.929250000000003],[118.60329000000002,31.933450000000004],[118.64819000000001,31.981750000000005],[118.65889000000001,31.965650000000004],[118.70649000000002,31.957850000000004],[118.75949000000001,32.01615],[118.79069000000001,31.998050000000003],[118.80459000000002,31.977850000000004]]]},"properties":{"ASCRIPTION":"","CNAME":"雨花台区","GB":"320114","area":132.05,"cname":"雨花台区","country":"中国","ename":"Yuhuatai Qu","gbcode":156320114,"lat":"31.994134","lng":"118.773854","population":391293,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.87539,32.01724],[118.83769,31.985850000000003],[118.80458999999999,31.977850000000004],[118.79068999999998,31.998050000000003],[118.75948999999999,32.01615],[118.75948999999999,32.043850000000006],[118.77888999999999,32.043850000000006],[118.83238999999999,32.04184000000001],[118.83888999999999,32.02624000000001],[118.87539,32.01724000000001]]]},"properties":{"ASCRIPTION":"","CNAME":"秦淮区","GB":"320104","area":49.04,"cname":"秦淮区","country":"中国","ename":"Qinhuai Qu","gbcode":156320104,"lat":"32.011944","lng":"118.791587","population":405955,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.75949,32.04385],[118.75949,32.016149999999996],[118.70649,31.957849999999997],[118.65889,31.965649999999997],[118.64819,31.981749999999998],[118.69099,32.05664],[118.72149,32.09494],[118.71769,32.04215],[118.75949,32.04385]]]},"properties":{"ASCRIPTION":"","CNAME":"建邺区","GB":"320105","area":80.25,"cname":"建邺区","country":"中国","ename":"Jianye Qu","gbcode":156320105,"lat":"32.033023","lng":"118.761087","population":427089,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.89229,32.02814],[118.87539,32.01724],[118.83888999999999,32.02624],[118.83238999999999,32.04184],[118.77888999999999,32.04385],[118.77878999999999,32.09095],[118.79458999999999,32.09715],[118.83178999999998,32.10705],[118.87948999999999,32.10555],[118.90458999999998,32.09145],[118.87308999999999,32.04875],[118.89228999999999,32.02814]]]},"properties":{"ASCRIPTION":"","CNAME":"玄武区","GB":"320102","area":75.27,"cname":"玄武区","country":"中国","ename":"Xuanwu Qu","gbcode":156320102,"lat":"32.050419","lng":"118.792903","population":651957,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.97419,31.76895],[118.94819,31.76885],[118.90069,31.78995],[118.89099,31.76705],[118.89799000000001,31.73425],[118.93049,31.71855],[118.94229,31.69415],[118.90199,31.68635],[118.88168999999999,31.64645],[118.85878999999998,31.648950000000003],[118.82818999999998,31.63265],[118.79758999999997,31.621450000000003],[118.76898999999997,31.68455],[118.74598999999998,31.679650000000002],[118.73048999999997,31.633250000000004],[118.67968999999998,31.638250000000003],[118.63868999999998,31.652150000000002],[118.64988999999998,31.677750000000003],[118.68748999999998,31.709450000000004],[118.67978999999998,31.726950000000002],[118.64898999999998,31.73225],[118.63668999999999,31.76035],[118.56669,31.74835],[118.55219,31.731749999999998],[118.53119,31.74065],[118.53459,31.76365],[118.47689,31.78025],[118.49959,31.84375],[118.52499,31.88025],[118.58739,31.92925],[118.58879,31.88795],[118.63109,31.86885],[118.68249,31.92515],[118.71199,31.928749999999997],[118.74409,31.914649999999998],[118.77099,31.919749999999997],[118.76409,31.957449999999998],[118.80458999999999,31.977849999999997],[118.83769,31.985849999999996],[118.87539,32.017239999999994],[118.89229,32.02813999999999],[118.90979,32.041549999999994],[118.91539,32.079649999999994],[118.96909000000001,32.111839999999994],[119.00299000000001,32.116339999999994],[119.01559000000002,32.11424999999999],[119.04039000000002,32.104049999999994],[119.07429000000002,32.10914999999999],[119.09309000000002,32.073449999999994],[119.08119000000002,32.055049999999994],[119.09249000000003,32.01304999999999],[119.10699000000002,32.00223999999999],[119.10559000000002,31.971249999999994],[119.04129000000002,31.970549999999996],[119.03219000000001,31.940849999999998],[119.06319000000002,31.941049999999997],[119.10299000000002,31.924749999999996],[119.10379000000002,31.886749999999996],[119.08639000000002,31.862449999999995],[119.06399000000002,31.870949999999997],[119.02059000000001,31.848249999999997],[118.97459,31.844349999999995],[119.00269,31.794249999999995],[118.97419000000001,31.768949999999993]]]},"properties":{"ASCRIPTION":"","CNAME":"江宁区","GB":"320115","area":1582.04,"cname":"江宁区","country":"中国","ename":"Jiangning Qu","gbcode":156320115,"lat":"31.954782","lng":"118.834917","population":1145628,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.79459,32.09715],[118.77879,32.09095],[118.77889,32.04385],[118.75949,32.04385],[118.71769,32.04215],[118.72149,32.09494],[118.76049,32.13445],[118.80079,32.12355],[118.79459,32.09715]]]},"properties":{"ASCRIPTION":"","CNAME":"鼓楼区","GB":"320106","area":53.93,"cname":"鼓楼区","country":"中国","ename":"Gulou Qu","gbcode":156320106,"lat":"32.06854","lng":"118.765089","population":826074,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[119.22369,32.22415],[119.23639,32.21835],[119.21269,32.19485],[119.18959,32.18665],[119.12388999999999,32.19384],[119.07708999999998,32.17985],[119.07058999999998,32.16355],[119.03578999999998,32.15914],[119.00298999999998,32.11634],[118.96908999999998,32.11184],[118.91538999999997,32.07965],[118.90978999999997,32.04155],[118.89228999999997,32.02814],[118.87308999999998,32.04875],[118.90458999999997,32.09145],[118.87948999999998,32.10555],[118.83178999999997,32.10705],[118.79458999999997,32.09715],[118.80078999999998,32.12355],[118.76048999999998,32.13445],[118.77158999999997,32.15995],[118.76248999999997,32.18974],[118.76858999999997,32.21435],[118.80198999999998,32.23055],[118.84358999999998,32.22505],[118.87088999999997,32.17985],[118.94648999999997,32.17734],[119.02848999999996,32.19095],[119.08058999999996,32.24304],[119.12688999999996,32.24705],[119.17178999999996,32.24085],[119.22368999999996,32.22415]]]},"properties":{"ASCRIPTION":"","CNAME":"栖霞区","GB":"320113","area":376.17,"cname":"栖霞区","country":"中国","ename":"Qixia Qu","gbcode":156320113,"lat":"32.098585","lng":"118.90403","population":644295,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[118.76249,32.18974],[118.77159,32.15995],[118.76049,32.13445],[118.72149,32.09494],[118.69099,32.05664],[118.64819,31.98175],[118.60329,31.93345],[118.58739,31.92925],[118.52499,31.88025],[118.49959,31.84375],[118.46169,31.86145],[118.46699000000001,31.88155],[118.38059000000001,31.91665],[118.35899,31.93195],[118.37129,31.98355],[118.38559000000001,31.99135],[118.37959000000001,32.05995],[118.41269000000001,32.08815],[118.45849000000001,32.10405],[118.49659000000001,32.14335],[118.49159000000002,32.18054],[118.54659000000002,32.20245],[118.57879000000003,32.20035],[118.64079000000002,32.21315],[118.67159000000002,32.25305],[118.69339000000002,32.25085],[118.71509000000002,32.25204],[118.71839000000001,32.22115],[118.74189000000001,32.18645],[118.76249000000001,32.18974]]]},"properties":{"ASCRIPTION":"","CNAME":"浦口区","GB":"320111","area":908.81,"cname":"浦口区","country":"中国","ename":"Pukou Qu","gbcode":156320111,"lat":"32.061034","lng":"118.623002","population":710298,"province":"江苏省","region":"华东地区","summarize":""}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[119.06199,32.46435],[119.04159,32.464850000000006],[119.01719,32.44234000000001],[119.01119,32.41514000000001],[119.03179,32.32885000000001],[119.03169,32.26185000000001],[119.08059,32.24304000000001],[119.02849,32.19095000000001],[118.94649000000001,32.17734000000001],[118.87089000000002,32.17985000000001],[118.84359000000002,32.22505000000001],[118.80199000000002,32.23055000000001],[118.76859000000002,32.21435000000001],[118.76249000000001,32.18974000000001],[118.74189000000001,32.18645000000001],[118.71839000000001,32.22115000000001],[118.71509000000002,32.25204000000001],[118.69339000000002,32.25085000000001],[118.67159000000002,32.25305000000001],[118.65399000000002,32.30554000000001],[118.68569000000002,32.33175000000001],[118.69669000000002,32.38134000000001],[118.68349000000002,32.40225000000001],[118.68769000000002,32.46775000000001],[118.64259000000001,32.47875000000001],[118.62309000000002,32.469850000000015],[118.58739000000001,32.483750000000015],[118.58729000000001,32.502150000000015],[118.61249000000001,32.51465000000002],[118.60379,32.53925000000002],[118.55869,32.566550000000014],[118.56409,32.58815000000001],[118.59308999999999,32.60355000000001],[118.62828999999999,32.579850000000015],[118.69278999999999,32.60845000000001],[118.71988999999999,32.610650000000014],[118.75228999999999,32.605950000000014],[118.77948999999998,32.584440000000015],[118.81938999999998,32.60455000000002],[118.82188999999998,32.574750000000016],[118.83838999999998,32.569150000000015],[118.88278999999997,32.589250000000014],[118.90088999999998,32.55455000000001],[118.93138999999998,32.56025000000001],[118.97468999999998,32.50595000000001],[119.01448999999998,32.520440000000015],[119.03598999999998,32.51665000000001],[119.06198999999998,32.46435000000001]]]},"properties":{"ASCRIPTION":"","CNAME":"六合区","GB":"320116","area":1477.56,"cname":"六合区","country":"中国","ename":"Luhe Qu","gbcode":156320116,"lat":"32.324363","lng":"118.816375","population":915625,"province":"江苏省","region":"华东地区","summarize":""}}]} -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 3 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 4 | cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= 5 | cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= 6 | cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= 7 | cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= 8 | cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= 9 | cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= 10 | cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= 11 | cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= 12 | cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= 13 | dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 14 | github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 15 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 16 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 17 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 18 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 19 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 20 | github.com/antonfisher/nested-logrus-formatter v1.3.0 h1:8zixYquU1Odk+vzAaAQPAdRh1ZjmUXNQ1T+dUBvlhVo= 21 | github.com/antonfisher/nested-logrus-formatter v1.3.0/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= 22 | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 23 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 24 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 25 | github.com/atlasdatatech/orb v0.2.2 h1:eJvcL8taHRzncteaHjfIyW6WZ1vbzTnS/ffABadLr10= 26 | github.com/atlasdatatech/orb v0.2.2/go.mod h1:pPwxxs3zoAyosNSbNKn1jiXV2+oovRDObDKfTvRegDI= 27 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 28 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 29 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= 30 | github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= 31 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 32 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 33 | github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= 34 | github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 35 | github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 36 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= 37 | github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 38 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 39 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 40 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 41 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 42 | github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 43 | github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= 44 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 45 | github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= 46 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 47 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 48 | github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= 49 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 50 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 51 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= 52 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 53 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 54 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 55 | github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 56 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 57 | github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 58 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 59 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 60 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 61 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 62 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 63 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 64 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 65 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 66 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 67 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 68 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 69 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 70 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 71 | github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= 72 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 73 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 74 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= 75 | github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= 76 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 77 | github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 78 | github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= 79 | github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 80 | github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= 81 | github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 82 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 83 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 84 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 85 | github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 86 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 87 | github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= 88 | github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= 89 | github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= 90 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 91 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 92 | github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 93 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 94 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 95 | github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= 96 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 97 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 98 | github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= 99 | github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 100 | github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 101 | github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= 102 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 103 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 104 | github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= 105 | github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= 106 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 107 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 108 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 109 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 110 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 111 | github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= 112 | github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 113 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 114 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 115 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 116 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 117 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 118 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 119 | github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= 120 | github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 121 | github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= 122 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 123 | github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= 124 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 125 | github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= 126 | github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 127 | github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= 128 | github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= 129 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 130 | github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 131 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= 132 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 133 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 134 | github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= 135 | github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 136 | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 137 | github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= 138 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 139 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 140 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 141 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 142 | github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= 143 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 144 | github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= 145 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 146 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 147 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 148 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 149 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 150 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 151 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 152 | github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= 153 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 154 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 155 | github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 156 | github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 157 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 158 | github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 159 | github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= 160 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 161 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 162 | github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 163 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 164 | github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02 h1:v9ezJDHA1XGxViAUSIoO/Id7Fl63u6d0YmsAm+/p2hs= 165 | github.com/shiena/ansicolor v0.0.0-20230509054315-a9deabde6e02/go.mod h1:RF16/A3L0xSa0oSERcnhd8Pu3IXSDZSK2gmGIMsttFE= 166 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 167 | github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= 168 | github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 169 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= 170 | github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 171 | github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= 172 | github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 173 | github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= 174 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 175 | github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= 176 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 177 | github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= 178 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 179 | github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= 180 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 181 | github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= 182 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 183 | github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= 184 | github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= 185 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 186 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 187 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 188 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= 189 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 190 | github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= 191 | github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= 192 | github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 h1:xzABM9let0HLLqFypcxvLmlvEciCHL7+Lv+4vwZqecI= 193 | github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569/go.mod h1:2Ly+NIftZN4de9zRmENdYbvPQeaVIYKWpLFStLFEBgI= 194 | github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= 195 | github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 196 | go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= 197 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 198 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 199 | go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= 200 | go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= 201 | go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 202 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 203 | golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 204 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 205 | golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 206 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 207 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 208 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 209 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 210 | golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= 211 | golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= 212 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 213 | golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 214 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 215 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 216 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 217 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 218 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 219 | golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 220 | golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 221 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 222 | golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 223 | golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= 224 | golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 225 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 226 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 227 | golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 228 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 229 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 230 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 231 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 232 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 233 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 234 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 235 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 236 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 237 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 238 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 239 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 240 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 241 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 242 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 243 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 244 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 245 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 246 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 247 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 248 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 249 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 250 | golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 251 | golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 252 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 253 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 254 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 255 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 256 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 257 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 258 | golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 259 | golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 260 | golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 261 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= 262 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 263 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 264 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 265 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 266 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 267 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 268 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 269 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 270 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 271 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 272 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 273 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 274 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 275 | golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 276 | golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 277 | golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 278 | golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 279 | golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 280 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 281 | golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 282 | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 283 | golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 284 | golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 285 | golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 286 | golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 287 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 288 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 289 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 290 | google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 291 | google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= 292 | google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 293 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 294 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 295 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 296 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 297 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 298 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 299 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 300 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 301 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 302 | google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 303 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 304 | google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= 305 | google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= 306 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 307 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 308 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 309 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 310 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 311 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 312 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 313 | gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= 314 | gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 315 | gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= 316 | gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= 317 | gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= 318 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 319 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 320 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 321 | gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= 322 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 323 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 324 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 325 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 326 | honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= 327 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 328 | --------------------------------------------------------------------------------