Documentation ¶
Index ¶
- type Division
- type RedisAdapter
- func (s RedisAdapter) GetCity(code int) (Division, error)
- func (s RedisAdapter) GetCounty(code int) (Division, error)
- func (s RedisAdapter) GetDivisionDetail(code int) ([]Division, error)
- func (s RedisAdapter) GetProvince(code int) (Division, error)
- func (s RedisAdapter) GetTown(code int) (Division, error)
- func (s RedisAdapter) ListNextDivision(code int) ([]Division, error)
- func (s RedisAdapter) ListProvince() []Division
- type WithoutRedisAdapter
- func (s WithoutRedisAdapter) GetCity(code int) (Division, error)
- func (s WithoutRedisAdapter) GetCounty(code int) (Division, error)
- func (s WithoutRedisAdapter) GetDivisionDetail(code int) ([]Division, error)
- func (s WithoutRedisAdapter) GetProvince(code int) (Division, error)
- func (s WithoutRedisAdapter) GetTown(code int) (Division, error)
- func (s WithoutRedisAdapter) ListNextDivision(code int) ([]Division, error)
- func (s WithoutRedisAdapter) ListProvince() []Division
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisAdapter ¶
type RedisAdapter struct {
// contains filtered or unexported fields
}
func InitDivisionWithRedisAdapter ¶
func InitDivisionWithRedisAdapter(fileDir string, db *redis.Client, level int, limitProvince map[int]struct{}) *RedisAdapter
func (RedisAdapter) GetCity ¶
func (s RedisAdapter) GetCity(code int) (Division, error)
GetCity get city information
func (RedisAdapter) GetDivisionDetail ¶
func (s RedisAdapter) GetDivisionDetail(code int) ([]Division, error)
GetDivisionDetail province-city-county,if the length of slice returned is 1 it means code is of province
func (RedisAdapter) GetProvince ¶
func (s RedisAdapter) GetProvince(code int) (Division, error)
GetProvince get province information
func (RedisAdapter) ListNextDivision ¶
func (s RedisAdapter) ListNextDivision(code int) ([]Division, error)
ListNextDivision list the next level divisions
func (RedisAdapter) ListProvince ¶
func (s RedisAdapter) ListProvince() []Division
ListProvince liat all provinces
type WithoutRedisAdapter ¶
type WithoutRedisAdapter struct { }
func InitDivisionWithOutRedisAdapter ¶
func InitDivisionWithOutRedisAdapter(fileDir string, level int) *WithoutRedisAdapter
func (WithoutRedisAdapter) GetCity ¶
func (s WithoutRedisAdapter) GetCity(code int) (Division, error)
GetCity get city information
func (WithoutRedisAdapter) GetCounty ¶
func (s WithoutRedisAdapter) GetCounty(code int) (Division, error)
GetCounty get county information
func (WithoutRedisAdapter) GetDivisionDetail ¶
func (s WithoutRedisAdapter) GetDivisionDetail(code int) ([]Division, error)
GetDivisionDetail province-city-county,if the length of slice returned is 1 it means code is of province
func (WithoutRedisAdapter) GetProvince ¶
func (s WithoutRedisAdapter) GetProvince(code int) (Division, error)
GetProvince get province information
func (WithoutRedisAdapter) GetTown ¶
func (s WithoutRedisAdapter) GetTown(code int) (Division, error)
GetTown get town information
func (WithoutRedisAdapter) ListNextDivision ¶
func (s WithoutRedisAdapter) ListNextDivision(code int) ([]Division, error)
ListNextDivision list the next level divisions
func (WithoutRedisAdapter) ListProvince ¶
func (s WithoutRedisAdapter) ListProvince() []Division
ListProvince liat all provinces
Source Files ¶
Click to show internal directories.
Click to hide internal directories.