webService

package
v0.0.0-...-ce5c6ab Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Geo   *geoService   //地理编码
	ReGeo *reGeoService //逆地理编码
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client, key string) *Client

type GeoCode

type GeoCode struct {
	FormattedAddress string `json:"formatted_address"`
	Country          string `json:"country"`
	Province         string `json:"province"`
	CityCode         string `json:"citycode"`
	City             string `json:"city"`
	District         string `json:"district"`
	Township         string `json:"township"`
	Neighborhood     struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"neighborhood"`
	Building struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"building"`
	AdCode   string `json:"adcode"`
	Street   string `json:"street"`
	Number   string `json:"number"`
	Location string `json:"location"`
	Level    string `json:"level"`
}

type GeoParam

type GeoParam struct {
	Key      string `url:"key,omitempty"`
	Address  string `url:"address"`
	City     string `url:"city,omitempty"`
	Batch    bool   `url:"batch,omitempty"`
	Sig      string `url:"sig,omitempty"`
	Output   string `url:"output,omitempty"`
	Callback string `url:"callback,omitempty"`
}

type GeoResp

type GeoResp struct {
	Status   string     `json:"status"`
	Info     string     `json:"info"`
	InfoCode string     `json:"infocode"`
	Count    string     `json:"count"`
	Geocodes []*GeoCode `json:"geocodes"`
}

type ReGeoCode

type ReGeoCode struct {
	FormattedAddress string `json:"formatted_address"`
	AddressComponent struct {
		Country      string   `json:"country"`
		Province     string   `json:"province"`
		City         []string `json:"city"`
		CityCode     string   `json:"citycode"`
		District     string   `json:"district"`
		AdCode       string   `json:"adcode"`
		Township     string   `json:"township"`
		TownCode     string   `json:"towncode"`
		Neighborhood struct {
			Name string `json:"name"`
			Type string `json:"type"`
		} `json:"neighborhood"`
		Building struct {
			Name string `json:"name"`
			Type string `json:"type"`
		} `json:"building"`
		StreetNumber struct {
			Street    string `json:"street"`
			Number    string `json:"number"`
			Location  string `json:"location"`
			Direction string `json:"direction"`
			Distance  string `json:"distance"`
		} `json:"streetNumber"`
		BusinessAreas []struct {
			Location string `json:"location"`
			Name     string `json:"name"`
			Id       string `json:"id"`
		} `json:"businessAreas"`
	} `json:"addressComponent"`
	Pois []struct {
		Id           string `json:"id"`
		Name         string `json:"name"`
		Type         string `json:"type"`
		Tel          string `json:"tel"`
		Direction    string `json:"direction"`
		Distance     string `json:"distance"`
		Location     string `json:"location"`
		Address      string `json:"address"`
		PoiWeight    string `json:"poiweight"`
		BusinessArea string `json:"businessarea"`
	} `json:"pois"`
	Roads []struct {
		Id        string `json:"id"`
		Name      string `json:"name"`
		Direction string `json:"direction"`
		Distance  string `json:"distance"`
		Location  string `json:"location"`
	} `json:"roads"`
	RoadInters []struct {
		Direction  string `json:"direction"`
		Distance   string `json:"distance"`
		Location   string `json:"location"`
		FirstId    string `json:"first_id"`
		FirstName  string `json:"first_name"`
		SecondId   string `json:"second_id"`
		SecondName string `json:"second_name"`
	} `json:"roadinters"`
	Aois []struct {
		Id       string `json:"id"`
		Name     string `json:"name"`
		AdCode   string `json:"adcode"`
		Location string `json:"location"`
		Area     string `json:"area"`
		Distance string `json:"distance"`
		Type     string `json:"type"`
	} `json:"aois"`
}

type ReGeoParam

type ReGeoParam struct {
	Key        string `url:"key"`
	Location   string `url:"location"`
	PoiType    string `url:"poitype,omitempty"`
	Radius     string `url:"radius,omitempty"`
	Extensions string `url:"extensions,omitempty"`
	Batch      bool   `url:"batch,omitempty"`
	RoadLevel  int    `url:"roadlevel,omitempty"`
	Sig        string `url:"sig,omitempty"`
	Output     string `url:"output,omitempty"`
	Callback   string `url:"callback,omitempty"`
	HomeOrCorp int    `url:"homeorcorp,omitempty"`
}

type ReGeoResp

type ReGeoResp struct {
	Status    string       `json:"status"`
	Info      string       `json:"info"`
	InfoCode  string       `json:"infocode"`
	ReGeoCode []*ReGeoCode `json:"regeocodes"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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