This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49b8c33
commit cddb946
Showing
6 changed files
with
196 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
* @Author: rootphantomer [email protected] | ||
* @Date: 2022-09-06 17:58:31 | ||
* @LastEditors: rootphantomer | ||
* @LastEditTime: 2022-09-10 12:54:02 | ||
* @LastEditTime: 2022-09-14 10:25:53 | ||
* @FilePath: /quake_go/src/model/reqjson.go | ||
* @Description:model | ||
* @Description:请求包结构体 | ||
* | ||
* Copyright (c) 2022 by rootphantomer, All Rights Reserved. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
* @Author: rootphantomer [email protected] | ||
* @Date: 2022-09-06 18:10:53 | ||
* @LastEditors: rootphantomer | ||
* @LastEditTime: 2022-09-10 12:50:32 | ||
* @LastEditTime: 2022-09-14 10:39:09 | ||
* @FilePath: /quake_go/src/model/respjson.go | ||
* @Description: | ||
* @Description:返回包结构体 | ||
* | ||
* Copyright (c) 2022 by rootphantomer, All Rights Reserved. | ||
*/ | ||
|
@@ -95,7 +95,90 @@ type ServiceJson struct { | |
} `json:"pagination"` | ||
} `json:"meta"` | ||
} | ||
|
||
type HostJson struct { | ||
Code int `json:"code"` | ||
Data []struct { | ||
Asn int `json:"asn"` | ||
Cdn struct { | ||
Domain string `json:"domain"` | ||
IsCdn bool `json:"is_cdn"` | ||
} `json:"cdn"` | ||
Components []map[string]interface{} `json:"Components"` | ||
// Components []struct { | ||
// ID string `json:"id"` | ||
// ProductCatalog []string `json:"product_catalog"` | ||
// ProductLevel string `json:"product_level"` | ||
// ProductNameCn string `json:"product_name_cn"` | ||
// ProductNameEn string `json:"product_name_en"` | ||
// ProductType []string `json:"product_type"` | ||
// ProductVendor string `json:"product_vendor"` | ||
// Version string `json:"version"` | ||
// } `json:"components"` | ||
Hostname string `json:"hostname"` | ||
ID string `json:"id"` | ||
Images []string `json:"images"` | ||
IP string `json:"ip"` | ||
IsIpv6 bool `json:"is_ipv6"` | ||
// Location map[string]string `json:"location"` | ||
Location struct { | ||
CityCn string `json:"city_cn"` | ||
CityEn string `json:"city_en"` | ||
CountryCn string `json:"country_cn"` | ||
CountryCode string `json:"country_code"` | ||
CountryEn string `json:"country_en"` | ||
DistrictCn string `json:"district_cn"` | ||
DistrictEn string `json:"district_en"` | ||
Isp string `json:"isp"` | ||
ProvinceCn string `json:"province_cn"` | ||
ProvinceEn string `json:"province_en"` | ||
Radius float64 `json:"radius"` | ||
SceneCn string `json:"scene_cn"` | ||
SceneEn string `json:"scene_en"` | ||
} `json:"location"` | ||
Org string `json:"org"` | ||
OsName string `json:"os_name"` | ||
OsVersion string `json:"os_version"` | ||
Port int `json:"port"` | ||
Service struct { | ||
Banner string `json:"banner"` | ||
Cert string `json:"cert"` | ||
HTTP map[string]interface{} `json:"http"` | ||
// HTTP struct { | ||
// Body string `json:"body"` | ||
// Favicon struct { | ||
// Data string `json:"data"` | ||
// Hash string `json:"hash"` | ||
// Location string `json:"location"` | ||
// } `json:"favicon"` | ||
// Host string `json:"host"` | ||
// HTMLHash string `json:"html_hash"` | ||
// MetaKeywords string `json:"meta_keywords"` | ||
// Path string `json:"path"` | ||
// ResponseHeaders string `json:"response_headers"` | ||
// Server string `json:"server"` | ||
// StatusCode int `json:"status_code"` | ||
// Title string `json:"title"` | ||
// XPoweredBy string `json:"x_powered_by"` | ||
// } `json:"http"` | ||
Name string `json:"name"` | ||
Product string `json:"product"` | ||
Response string `json:"response"` | ||
Version string `json:"version"` | ||
} `json:"service"` | ||
SysTag []string `json:"sys_tag"` | ||
Time string `json:"time"` | ||
Transport string `json:"transport"` | ||
} `json:"data"` | ||
Message string `json:"message"` | ||
Meta struct { | ||
Pagination struct { | ||
Count int `json:"count"` | ||
PageIndex int `json:"page_index"` | ||
PageSize int `json:"page_size"` | ||
Total int `json:"total"` | ||
} `json:"pagination"` | ||
} `json:"meta"` | ||
} | ||
type InfoJson struct { | ||
Code int `json:"code"` | ||
Data struct { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
* @Author: rootphantomer [email protected] | ||
* @Date: 2022-09-06 16:04:43 | ||
* @LastEditors: rootphantomer | ||
* @LastEditTime: 2022-09-09 18:13:59 | ||
* @LastEditTime: 2022-09-14 10:39:54 | ||
* @FilePath: /quake_go/src/utils/LoadJson.go | ||
* @Description: | ||
* @Description:解析json的逻辑代码 | ||
* | ||
* Copyright (c) 2022 by rootphantomer, All Rights Reserved. | ||
*/ | ||
|
@@ -26,6 +26,16 @@ func SeriveLoadJson(body string) (result ServiceJson) { | |
} | ||
return | ||
} | ||
func HostLoadJson(body string) (result HostJson) { | ||
var hostjson HostJson | ||
|
||
if err := json.Unmarshal([]byte(body), &hostjson); err == nil { | ||
result = hostjson | ||
} else { | ||
fmt.Println(err) | ||
} | ||
return | ||
} | ||
func SeriveLoadJson2(body string) (result []map[string]string) { | ||
var servicemapjson map[string][]map[string]string | ||
|
||
|