Documentation ¶
Index ¶
- type CustomTime
- func (t CustomTime) IsZero() bool
- func (t CustomTime) MarshalJSON() ([]byte, error)
- func (t CustomTime) MarshalText() ([]byte, error)
- func (t *CustomTime) Scan(value interface{}) error
- func (t *CustomTime) UnmarshalJSON(data []byte) error
- func (t *CustomTime) UnmarshalText(text []byte) error
- func (t CustomTime) Value() (driver.Value, error)
- type Date
- func (t Date) IsZero() bool
- func (t Date) MarshalJSON() ([]byte, error)
- func (t Date) MarshalText() ([]byte, error)
- func (t *Date) Scan(value interface{}) error
- func (t *Date) UnmarshalJSON(data []byte) error
- func (t *Date) UnmarshalText(text []byte) error
- func (t Date) Value() (driver.Value, error)
- type Hour
- func (t Hour) IsZero() bool
- func (t Hour) MarshalJSON() ([]byte, error)
- func (t Hour) MarshalText() ([]byte, error)
- func (t *Hour) Scan(value interface{}) error
- func (t *Hour) UnmarshalJSON(data []byte) error
- func (t *Hour) UnmarshalText(text []byte) error
- func (t Hour) Value() (driver.Value, error)
- type Minute
- func (t Minute) IsZero() bool
- func (t Minute) MarshalJSON() ([]byte, error)
- func (t Minute) MarshalText() ([]byte, error)
- func (t *Minute) Scan(value interface{}) error
- func (t *Minute) UnmarshalJSON(data []byte) error
- func (t *Minute) UnmarshalText(text []byte) error
- func (t Minute) Value() (driver.Value, error)
- type Second
- func (t Second) IsZero() bool
- func (t Second) MarshalJSON() ([]byte, error)
- func (t Second) MarshalText() ([]byte, error)
- func (t *Second) Scan(value interface{}) error
- func (t *Second) UnmarshalJSON(data []byte) error
- func (t *Second) UnmarshalText(text []byte) error
- func (t Second) Value() (driver.Value, error)
- type Timestamp
- func (t Timestamp) IsZero() bool
- func (t Timestamp) MarshalJSON() ([]byte, error)
- func (t Timestamp) MarshalText() ([]byte, error)
- func (t *Timestamp) Scan(value interface{}) error
- func (t *Timestamp) UnmarshalJSON(data []byte) error
- func (t *Timestamp) UnmarshalText(text []byte) error
- func (t Timestamp) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomTime ¶
type CustomTime struct { Format string // contains filtered or unexported fields }
CustomTime is a nullable time.Time. It supports SQL, JSON serialization AND custom format. It will marshal to null if null.
func NewCustomTime ¶
func NewCustomTime(s int64, format string) CustomTime
new custom format of time, s is timestamp examples: ANSIC = "Mon Jan _2 15:04:05 2006" UnixDate = "Mon Jan _2 15:04:05 MST 2006" RubyDate = "Mon Jan 02 15:04:05 -0700 2006" RFC822 = "02 Jan 06 15:04 MST" RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone RFC850 = "Monday, 02-Jan-06 15:04:05 MST" RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone RFC3339 = "2006-01-02T15:04:05Z07:00" RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00" Kitchen = "3:04PM" // Handy time stamps. Stamp = "Jan _2 15:04:05" StampMilli = "Jan _2 15:04:05.000" StampMicro = "Jan _2 15:04:05.000000" StampNano = "Jan _2 15:04:05.000000000"
func NewCustomTimeFrom ¶
func NewCustomTimeFrom(t time.Time, format string) CustomTime
new custom format of time from time.Time
func NewCustomTimeNow ¶
func NewCustomTimeNow(format string) CustomTime
new custom format of time right now
func (CustomTime) IsZero ¶
func (t CustomTime) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (CustomTime) MarshalJSON ¶
func (t CustomTime) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (*CustomTime) Scan ¶
func (t *CustomTime) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*CustomTime) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*CustomTime) UnmarshalText ¶
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
Date is a nullable time.Time. It supports SQL, JSON serialization AND datetime format(2006-01-02). It will marshal to null if null.
func (Date) IsZero ¶
func (t Date) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (Date) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (*Date) Scan ¶
func (t *Date) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*Date) UnmarshalText ¶
type Hour ¶
type Hour struct {
// contains filtered or unexported fields
}
Hour is a nullable time.Time. It supports SQL, JSON serialization AND datetime format(2006-01-02 15). It will marshal to null if null.
func (Hour) IsZero ¶
func (t Hour) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (Hour) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (*Hour) Scan ¶
func (t *Hour) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*Hour) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*Hour) UnmarshalText ¶
type Minute ¶
type Minute struct {
// contains filtered or unexported fields
}
Minute is a nullable time.Time. It supports SQL, JSON serialization AND datetime format(2006-01-02 15). It will marshal to null if null.
func NewMinuteFrom ¶
new Minute format of time from time.Time
func (Minute) IsZero ¶
func (t Minute) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (Minute) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (*Minute) Scan ¶
func (t *Minute) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*Minute) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*Minute) UnmarshalText ¶
type Second ¶
type Second struct {
// contains filtered or unexported fields
}
Second is a nullable time.Time. It supports SQL, JSON serialization AND datetime format(2006-01-02 15:04:05). It will marshal to null if null.
func NewSecondFrom ¶
new Second format of time from time.Time
func (Second) IsZero ¶
func (t Second) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (Second) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (*Second) Scan ¶
func (t *Second) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*Second) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*Second) UnmarshalText ¶
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}
Timestamp is a nullable time.Time. It supports SQL, JSON serialization AND timestamp format. It will marshal to null if null.
func NewTimestampFrom ¶
new timestamp format of time from time.Time
func (Timestamp) IsZero ¶
func (t Timestamp) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (Timestamp) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (*Timestamp) Scan ¶
func (t *Timestamp) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.