Documentation
¶
Index ¶
- Constants
- func Idx() []contract.IndexEntry
- func IdxSrch() []contract.SearchIndexEntry
- func Rules() contractpkg.QueryParamRules
- 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 Core
- type CoreOption
- 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" DateTimezoneKey = "date_timezone" )
Variables ¶
This section is empty.
Functions ¶
func Idx ¶ added in v0.0.30
func Idx() []contract.IndexEntry
func IdxSrch ¶ added in v0.0.30
func IdxSrch() []contract.SearchIndexEntry
func Rules ¶ added in v0.0.24
func Rules() contractpkg.QueryParamRules
Types ¶
type Comp ¶
type Comp struct {
ProcessedDate *time.Time `json:"processed_date" validate:"nnpt,nz,utc"`
Day *uint `json:"day" validate:"nnpt,nz,dayrange"`
Month *uint `json:"month" validate:"nnpt,nz,monthrange"`
Year *uint `json:"year" validate:"nnpt,nz"`
Hour *uint `json:"hour" validate:"nnpt"`
}
func (*Comp) GetProcessedDate ¶
func (*Comp) SetProcessedDate ¶
type Core ¶
type Core struct {
Date *time.Time `json:"date" validate:"nnpt,nz"`
DateTimezone *string `json:"date_timezone" validate:"nnpt,nz,tz"`
}
func ApplyCore ¶
func ApplyCore(c *Core, modifiers ...CoreOption) Core
func (*Core) GetDateTimezone ¶ added in v0.0.73
func (*Core) SetDateTimezone ¶ added in v0.0.73
type CoreOption ¶
type CoreOption = contracti.CoreOption[Core]
func WithDate ¶
func WithDate(x time.Time) CoreOption
func WithDateTimezone ¶ added in v0.0.73
func WithDateTimezone(x string) CoreOption
type Date ¶
type Date struct {
Meta `bson:",inline" validate:"recurse"`
Comp `bson:",inline" validate:"recurse"`
Core `bson:",inline" validate:"recurse"`
}
Date represents a date optimized for handling multiple time zones, and query parameter filtering.
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.