residentid

package
v0.0.0-...-2fc83c6 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package residentid 实现居民身份证号的处理逻辑

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetailInfo

type DetailInfo struct {
	Hometown []*admindivision.Division
	Birthday time.Time
	Gender   Gender
}

DetailInfo 表示身份证详细信息, 便于一次性获取

func (DetailInfo) String

func (inf DetailInfo) String() string

type Gender

type Gender int8

Gender 性别, 只分男女

const (
	// UnknownGender 只在 ID 不合法的时候返回
	UnknownGender Gender = iota
	// Male 男性
	Male
	// Female 女性
	Female
)

func (Gender) String

func (g Gender) String() string

type ID

type ID struct {
	// contains filtered or unexported fields
}

ID 表示一个身份证号及相关信息

func New

func New(num string) (ID, error)

New 新建一个 ID

func (ID) Birthday

func (id ID) Birthday() time.Time

Birthday 生日

func (ID) DetailInfo

func (id ID) DetailInfo() DetailInfo

DetailInfo 返回详细描述

func (ID) Gender

func (id ID) Gender() Gender

Gender 性别

func (ID) Hometown

func (id ID) Hometown() []*admindivision.Division

Hometown 返回身份证上的家乡信息

func (ID) String

func (id ID) String() string

Jump to

Keyboard shortcuts

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