area

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

View Source
var (
	Maps           []Location
	MapsSimplified []LocationSimplified
	MapsFlatten    map[string]string
	ProvinceMap    = map[string]string{} // 省份
	CityMap        = map[string]string{} // 城市
	AreaMap        = map[string]string{} // 地区
	StreetMap      = map[string]string{} // 街道
)

Functions

func CoverToLocationFlatten added in v0.6.0

func CoverToLocationFlatten() map[string]string

把地区转换成简版,为了省流量支持

func IsValid

func IsValid(provinceCode string, cityCode string, areaCode string, streetCode string) bool

Types

type Location

type Location struct {
	Name     string     `json:"name"`
	Code     string     `json:"code"`
	Children []Location `json:"children,omitempty"`
}

func LookUp

func LookUp(fullAreaCode string) (*Location, error)

type LocationSimplified added in v0.6.0

type LocationSimplified struct {
	N string               `json:"n"`           // 名称 name
	C string               `json:"c"`           // 代码 code
	S []LocationSimplified `json:"s,omitempty"` // 子地区 sub
}

func CoverToLocationSimplified added in v0.6.0

func CoverToLocationSimplified(maps []Location) (result []LocationSimplified)

把地区转换成简版,为了省流量支持

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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