Documentation ¶
Overview ¶
Package time defines time based on the domain logic. It ensures that time within the application is aligned with the requirements and constraints dictated by the domain.
Index ¶
- type Timestamp
- func (t Timestamp) Add(amount int64) Timestamp
- func (t Timestamp) MarshalJSON() ([]byte, error)
- func (t Timestamp) String() string
- func (t Timestamp) Sub(amount int64) Timestamp
- func (t Timestamp) ToInt64() int64
- func (t Timestamp) UnixNano() int64
- func (t *Timestamp) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}
Timestamp defines an instant in time with milliseconds precision.
func Now ¶
func Now() Timestamp
Now creates a new Timestamp with the current instant of time in milliseconds since January 1, 1970, UTC
func TimestampFromInt64 ¶
TimestampFromInt64 creates a new Timestamp from the provided int64
func (Timestamp) Add ¶
Add creates a new Timestamp with the result of the sum for the timestamp and the amount provided as parameter.
func (Timestamp) MarshalJSON ¶
MarshalJSON returns Timestamp JSON-marshalled output or error if it fails
func (Timestamp) Sub ¶
Sub creates a new Timestamp with the result of the rest for the timestamp and the amount provided as parameter.
func (Timestamp) UnixNano ¶
UnixNano returns the timestamp as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON unmarshalls JSON data into Timestamp or returns an error if it fails