Documentation
¶
Index ¶
- Constants
- type Birthday
- type Email
- func (e Email) Address() string
- func (e Email) DomainASCII() (string, error)
- func (e Email) Equal(o Email) bool
- func (e Email) IsEmpty() bool
- func (e Email) LocalPart() (string, error)
- func (e Email) MarshalJSON() ([]byte, error)
- func (e *Email) Scan(src any) error
- func (e Email) String() string
- func (e *Email) UnmarshalJSON(b []byte) error
- func (e Email) Value() (driver.Value, error)
- type Gender
- type ID
- type IDCard
- type IDNumber
- func (id IDNumber) BirthDate() (time.Time, error)
- func (id IDNumber) Equal(o IDNumber) bool
- func (id IDNumber) IsEmpty() bool
- func (id IDNumber) IsMale() (bool, error)
- func (id IDNumber) IsValid() bool
- func (id IDNumber) MarshalJSON() ([]byte, error)
- func (id IDNumber) Number() string
- func (id IDNumber) ProvinceCode() string
- func (id *IDNumber) Scan(src any) error
- func (id IDNumber) String() string
- func (id *IDNumber) UnmarshalJSON(b []byte) error
- func (id IDNumber) Value() (driver.Value, error)
- type Phone
- func (p Phone) Equal(o Phone) bool
- func (p Phone) IsEmpty() bool
- func (p Phone) MarshalJSON() ([]byte, error)
- func (p Phone) Number() string
- func (p Phone) Region() (string, error)
- func (p *Phone) Scan(src any) error
- func (p Phone) String() string
- func (p *Phone) UnmarshalJSON(b []byte) error
- func (p Phone) Value() (driver.Value, error)
Constants ¶
View Source
const ZeroAsNull = true
0 是否当成 NULL 处理
View Source
const ZeroID = ID(0)
0 ID 常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Birthday ¶
type Birthday struct {
// contains filtered or unexported fields
}
type Email ¶
type Email struct {
// contains filtered or unexported fields
}
Email 邮箱值对象
func (Email) DomainASCII ¶
func (Email) MarshalJSON ¶
MarshalJSON 实现 json.Marshaler 接口,返回 JSON 编码值
func (*Email) UnmarshalJSON ¶
UnmarshalJSON 实现 json.Unmarshaler 接口,解析 JSON 编码值
type ID ¶
type ID int64
ID:用 int64 映射数据库 BIGINT,天然规避 > MaxInt64 的问题
func (*ID) UnmarshalJSON ¶
UnmarshalJSON 实现 json.Unmarshaler 接口
type IDCard ¶
type IDCard struct {
// contains filtered or unexported fields
}
IDCard 身份证值对象
type IDNumber ¶
type IDNumber struct {
// contains filtered or unexported fields
}
func NewIDNumber ¶
NewIDNumber 解析/校验/归一化(支持 15 位旧号,自动转成 18 位)
func (IDNumber) MarshalJSON ¶
func (*IDNumber) UnmarshalJSON ¶
type Phone ¶
type Phone struct {
// contains filtered or unexported fields
}
Phone 电话号码值对象
func (Phone) MarshalJSON ¶
MarshalJSON 实现 json.Marshaler 接口,返回 JSON 编码值
func (*Phone) UnmarshalJSON ¶
UnmarshalJSON 实现 json.Unmarshaler 接口,解析 JSON 编码值
Click to show internal directories.
Click to hide internal directories.