Documentation ¶
Index ¶
- Constants
- type Gender
- type IDCard
- type IDParser
- func (s *IDParser) GetAge() int
- func (s *IDParser) GetBirthday() (time.Time, error)
- func (s *IDParser) GetCity() (string, error)
- func (s *IDParser) GetCode() string
- func (s *IDParser) GetGender() Gender
- func (s *IDParser) GetProvince() (string, error)
- func (s *IDParser) GetVersion() Version
- func (s *IDParser) Init(uniqueIDCode string, doCheck bool) error
- func (s *IDParser) IsLegal() bool
- type Version
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDCard ¶
type IDCard interface { GetCity() (string, error) // 获取市、县 GetProvince() (string, error) // 获取省、直辖市 GetCode() string // 获取身份证号码 GetAge() int // 获取年龄 GetBirthday() (time.Time, error) // 获取生日 GetGender() Gender // 获取性别,2:女 1:男 GetVersion() Version // 获取身份证版本 IsLegal() bool // 校验是否为合法身份证,仅校验身份证合法性 }
IDCard 身份证解析器
type IDParser ¶
type IDParser struct {
// contains filtered or unexported fields
}
func (*IDParser) GetProvince ¶
func (*IDParser) GetVersion ¶
Click to show internal directories.
Click to hide internal directories.