gaode

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAddress

func WithAddress(address string) func(*Geocode)

Types

type Gaode

type Gaode struct {
	Key string
}

type Geocode

type Geocode struct {
	Gaode

	Address string
}

func NewGeocode

func NewGeocode(key string, options ...func(*Geocode)) *Geocode

func (*Geocode) Query

func (g *Geocode) Query() ([]byte, error)

type GeocodeItem

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

type GeocodeRes

type GeocodeRes struct {
	Status   string        `json:"status,omitempty"`
	Info     string        `json:"info,omitempty"`
	InfoCode string        `json:"infocode,omitempty"`
	Count    string        `json:"count,omitempty"`
	Geocodes []GeocodeItem `json:"geocodes,omitempty"`
}

Jump to

Keyboard shortcuts

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