Documentation ¶
Index ¶
- Variables
- func GetAllCityStr(hasSuffix bool) []string
- func GetGytStr() []string
- func GetZcsStr(hasSuffix bool) []string
- func GroupCityByP1() map[string][]*TreeNode
- func GroupCityByP1String(hasSuffix bool) map[string][]string
- func ProvinceGetCityStr(provinceName string, hasSuffix bool) ([]string, bool)
- type TreeBase
- type TreeNode
- func AdCodeGet(code string) *TreeNode
- func GetAllCity() []TreeNode
- func GetCodes(codes ...string) []TreeNode
- func GetProvince() []TreeNode
- func GetZsc() []TreeNode
- func Match(name string) (*TreeNode, bool)
- func ProvinceGetCity(provinceName string) ([]TreeNode, bool)
- func RandomGet(count uint8, exclude ...string) []TreeNode
- func Search(name string) []TreeNode
Constants ¶
This section is empty.
Variables ¶
View Source
var FlatData = make([]*TreeNode, 0)
View Source
var TreeData = make([]*TreeNode, 0)
Functions ¶
func GetAllCityStr ¶
func GroupCityByP1 ¶
func GroupCityByP1String ¶
Types ¶
type TreeBase ¶
type TreeBase struct { Adcode string `json:"adcode"` // 唯一id 数字的 Name string `json:"name"` // 名称 Suffix string `json:"suffix"` // 后缀 }
func GetAllCityBase ¶
func GetAllCityBase() []TreeBase
func GetZscBase ¶
func GetZscBase() []TreeBase
type TreeNode ¶
type TreeNode struct { TreeBase Parent string `json:"parent"` // 这个是父级的adcode Py string `json:"py"` // 拼音 Pf string `json:"pf"` // 拼音首字符 P1 string `json:"p1"` // 拼音首字母 IsProvince bool `json:"is_province"` // 省份 IsCity bool `json:"is_city"` // 城市 IsNyc bool `json:"is_nyc"` // 直辖市 Lat float64 `json:"lat" ` Lng float64 `json:"lng"` Children []*TreeNode `json:"children"` }
func ProvinceGetCity ¶
ProvinceGetCity 省份名称获取下属城市
Click to show internal directories.
Click to hide internal directories.