Documentation
¶
Index ¶
- Constants
- func ValidatePhoneNumber(s string) error
- type Email
- func (e Email) MarshalJSON() ([]byte, error)
- func (e Email) MarshalText() ([]byte, error)
- func (e *Email) Scan(value any) error
- func (e Email) String() string
- func (e *Email) UnmarshalJSON(b []byte) error
- func (e *Email) UnmarshalText(text []byte) error
- func (e Email) Validate() error
- func (e Email) Value() (driver.Value, error)
- type Language
- type Locale
- type ModelWithCursor
- type PhoneNumber
- func (p PhoneNumber) MarshalJSON() ([]byte, error)
- func (p PhoneNumber) MarshalText() ([]byte, error)
- func (p *PhoneNumber) Scan(value any) error
- func (p PhoneNumber) String() string
- func (p *PhoneNumber) UnmarshalJSON(b []byte) error
- func (p *PhoneNumber) UnmarshalText(text []byte) error
- func (p PhoneNumber) Validate() error
- func (p PhoneNumber) Value() (driver.Value, error)
- type UnixSeconds
- func (us UnixSeconds) FormatDate() string
- func (us UnixSeconds) FormatDateInTimezone(tz string) (string, error)
- func (us UnixSeconds) IsZero() bool
- func (us UnixSeconds) MarshalJSON() ([]byte, error)
- func (us *UnixSeconds) Scan(v any) error
- func (us UnixSeconds) Time() time.Time
- func (us *UnixSeconds) UnmarshalJSON(data []byte) error
- func (us UnixSeconds) Value() (driver.Value, error)
Constants ¶
const DEFAULT_LOCALE = "en-US"
Variables ¶
This section is empty.
Functions ¶
func ValidatePhoneNumber ¶ added in v1.5.1
Types ¶
type Email ¶ added in v1.5.1
type Email string
func (Email) MarshalJSON ¶ added in v1.5.1
func (Email) MarshalText ¶ added in v1.5.1
func (*Email) UnmarshalJSON ¶ added in v1.5.1
func (*Email) UnmarshalText ¶ added in v1.5.1
type Locale ¶ added in v1.5.1
type Locale string
Locale is a string type with validation
func NewLocaleString ¶ added in v1.5.1
NewLocaleString creates a validated locale string
func (Locale) MarshalJSON ¶ added in v1.5.1
MarshalJSON implements json.Marshaler
func (*Locale) UnmarshalJSON ¶ added in v1.5.1
UnmarshalJSON implements json.Unmarshaler
type ModelWithCursor ¶
type ModelWithCursor interface {
GetCursor() string
}
type PhoneNumber ¶ added in v1.5.1
type PhoneNumber string
func NewPhoneNumber ¶ added in v1.5.1
func NewPhoneNumber(s string) (PhoneNumber, error)
NewPhoneNumber validates and returns a PhoneNumber.
func (PhoneNumber) MarshalJSON ¶ added in v1.5.1
func (p PhoneNumber) MarshalJSON() ([]byte, error)
func (PhoneNumber) MarshalText ¶ added in v1.5.1
func (p PhoneNumber) MarshalText() ([]byte, error)
func (*PhoneNumber) Scan ¶ added in v1.5.1
func (p *PhoneNumber) Scan(value any) error
func (PhoneNumber) String ¶ added in v1.5.1
func (p PhoneNumber) String() string
func (*PhoneNumber) UnmarshalJSON ¶ added in v1.5.1
func (p *PhoneNumber) UnmarshalJSON(b []byte) error
func (*PhoneNumber) UnmarshalText ¶ added in v1.5.1
func (p *PhoneNumber) UnmarshalText(text []byte) error
func (PhoneNumber) Validate ¶ added in v1.5.1
func (p PhoneNumber) Validate() error
Validate re-validates the value (useful after deserialization).
type UnixSeconds ¶ added in v1.5.2
type UnixSeconds int64
UnixSeconds is seconds since Unix epoch (1970-01-01T00:00:00Z)
func UnixSecondsFromRFC3339 ¶ added in v1.5.2
func UnixSecondsFromRFC3339(dateString string) (UnixSeconds, error)
UnixSecondsFromRFC3339 parses an RFC3339/RFC3339Nano string into Unix seconds
func UnixSecondsFromTime ¶ added in v1.5.2
func UnixSecondsFromTime(t time.Time) UnixSeconds
UnixSecondsFromTime converts a time.Time to Unix seconds (truncates sub-second)
func UnixSecondsNow ¶ added in v1.5.2
func UnixSecondsNow() UnixSeconds
UnixSecondsNow returns the current time in Unix seconds
func (UnixSeconds) FormatDate ¶ added in v1.5.2
func (us UnixSeconds) FormatDate() string
FormatDate returns dd/mm/yyyy
func (UnixSeconds) FormatDateInTimezone ¶ added in v1.5.2
func (us UnixSeconds) FormatDateInTimezone(tz string) (string, error)
FormatDateInTimezone returns dd/mm/yyyy rendered in the provided IANA timezone
func (UnixSeconds) IsZero ¶ added in v1.5.2
func (us UnixSeconds) IsZero() bool
IsZero reports whether us == 0
func (UnixSeconds) MarshalJSON ¶ added in v1.5.2
func (us UnixSeconds) MarshalJSON() ([]byte, error)
MarshalJSON emits a JSON number (unix seconds)
func (*UnixSeconds) Scan ¶ added in v1.5.2
func (us *UnixSeconds) Scan(v any) error
Scan implements sql.Scanner for BIGINT (and a few driver variants).
func (UnixSeconds) Time ¶ added in v1.5.2
func (us UnixSeconds) Time() time.Time
Time converts UnixSeconds back to time.Time
func (*UnixSeconds) UnmarshalJSON ¶ added in v1.5.2
func (us *UnixSeconds) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts a JSON number (unix seconds)