Documentation
¶
Index ¶
- Constants
- type Comp
- func (c *Comp) GetDay() uint
- func (c *Comp) GetHour() uint
- func (c *Comp) GetMonth() uint
- func (c *Comp) GetProcessedDate() time.Time
- func (c *Comp) GetYear() uint
- func (c *Comp) SetDay(x uint)
- func (c *Comp) SetHour(x uint)
- func (c *Comp) SetMonth(x uint)
- func (c *Comp) SetProcessedDate(x time.Time)
- func (c *Comp) SetYear(x uint)
- type CompOption
- func WithDay(day uint) CompOption
- func WithHour(hour uint) CompOption
- func WithMonth(month uint) CompOption
- func WithProcessedDate(date time.Time) CompOption
- func WithProcessing(timezone string, toUTC, toMidnight bool, originalDate time.Time, ...) (CompOption, error)
- func WithYear(year uint) CompOption
- type Date
- type Meta
- type MetaOption
Constants ¶
View Source
const ( DayKey = "day" MonthKey = "month" YearKey = "year" HourKey = "hour" ProcessedDateKey = "processed_date" )
View Source
const (
DateKey = "date"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comp ¶
type Comp struct {
// ProcessedDate is the date after timezone override, normalization to midnight, and conversion to UTC. If no processing occurs, this field equals the Date field.
// example:2021-01-01T00:00:00Z
// readOnly:true
ProcessedDate *time.Time `json:"processed_date" bson:"processed_date" validate:"nonnilpointer,nonzeropointerelem,isutc"`
// Day is the day extracted from the normalized date.
// example:1
// readOnly:true
Day *uint `json:"day" bson:"day" validate:"nonnilpointer,nonzeropointerelem,dayrange"`
// Month is the month extracted from the normalized date.
// example:1
// readOnly:true
Month *uint `json:"month" bson:"month" validate:"nonnilpointer,nonzeropointerelem,monthrange"`
// Year is the year extracted from the normalized date.
// example:2021
// readOnly:true
Year *uint `json:"year" bson:"year" validate:"nonnilpointer,nonzeropointerelem"`
// Hour is the hour extracted from the normalized date.
// example:0
// readOnly:true
Hour *uint `json:"hour" bson:"hour" validate:"nonnilpointer"`
}
func ApplyComp ¶
func ApplyComp(c *Comp, modifiers ...CompOption) Comp
func (*Comp) GetProcessedDate ¶
func (*Comp) SetProcessedDate ¶
type CompOption ¶
type CompOption = contract.CompOption[Comp]
func WithDay ¶
func WithDay(day uint) CompOption
func WithHour ¶
func WithHour(hour uint) CompOption
func WithMonth ¶
func WithMonth(month uint) CompOption
func WithProcessedDate ¶
func WithProcessedDate(date time.Time) CompOption
func WithProcessing ¶
func WithYear ¶
func WithYear(year uint) CompOption
type Date ¶
type Date struct {
Meta `bson:",inline"`
Comp `bson:",inline"`
// Date is the input date and time in RFC 3339 format to be processed.
// example:2021-01-01T00:00:00Z
// required:true
// format:date-time
Date *time.Time `json:"date" bson:"date" validate:"nonnilpointer,nonzeropointerelem"`
}
Date represents a date optimized for handling multiple time zones, and query parameter filtering. swagger:model
type Meta ¶
type Meta struct{}
func ApplyMeta ¶
func ApplyMeta(m *Meta, modifiers ...MetaOption) Meta
type MetaOption ¶
type MetaOption = contract.MetaOption[Meta]
Click to show internal directories.
Click to hide internal directories.