cnregion

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 5 Imported by: 0

README

cn-region

Administrative divisions of China parser

Documentation

Index

Constants

View Source
const Binding = "cnregion"

Variables

Functions

This section is empty.

Types

type CnRegion

type CnRegion struct{}

func NewCnRegion

func NewCnRegion() *CnRegion

func (*CnRegion) ParseByCode

func (r *CnRegion) ParseByCode(code string) (province, city, area, street string, err error)

func (*CnRegion) ParseByName

func (r *CnRegion) ParseByName(province, city, area string, street ...string) (code string, err error)

ParseByName 根据省市区街道反向解析出编码

func (*CnRegion) Search

func (r *CnRegion) Search(keyword string) (result []Region)

Search 通过关键字搜索省市区街道编码

type Region

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

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (receiver *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (receiver *ServiceProvider) Register(app foundation.Application)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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