Documentation
¶
Index ¶
Constants ¶
View Source
const ( LeadTimeInHoursKey = "lead_time_in_hours" IsActiveKey = "is_active" AutoStartKey = "auto_start" )
Variables ¶
View Source
var ( LeadTimeInHoursKeyFn = contract.PathKeyFn(LeadTimeInHoursKey) IsActiveKeyFn = contract.PathKeyFn(IsActiveKey) AutoStartKeyFn = contract.PathKeyFn(AutoStartKey) )
Functions ¶
func Idx ¶
func Idx(p ...string) []contract.IndexEntry
func IdxSrch ¶
func IdxSrch(p ...string) []contract.SearchIndexEntry
func Rules ¶
func Rules(p ...string) contractpkg.QueryParamRules
Types ¶
type Activation ¶
type Activation struct {
Meta `bson:",inline" validate:"recurse"`
Core `bson:",inline" validate:"recurse"`
}
Activation represents an activation of a worksite or a job.
func Mock ¶
func Mock() *Activation
func New ¶
func New(m Meta, cr Core) *Activation
type Core ¶
type Core struct {
// LeadTimeInHours defines how many hours in advance the activation occurs.
LeadTimeInHours *int64 `json:"lead_time_in_hours" validate:"nnpt"`
// IsActive indicates whether the entity is currently active based on its schedule.
IsActive *bool `json:"is_active" validate:"nnpt"`
// AutoStart determines if the entity should start automatically when activated.
AutoStart *bool `json:"auto_start" validate:"nnpt"`
}
func ApplyCore ¶
func ApplyCore(c *Core, modifiers ...CoreOption) Core
func (*Core) GetAutoStart ¶
func (*Core) GetIsActive ¶
func (*Core) GetLeadTimeInHours ¶ added in v0.0.68
func (*Core) SetAutoStart ¶
func (*Core) SetIsActive ¶
func (*Core) SetLeadTimeInHours ¶ added in v0.0.68
type CoreOption ¶
type CoreOption = contracti.CoreOption[Core]
func WithAutoStart ¶
func WithAutoStart(x bool) CoreOption
func WithIsActive ¶
func WithIsActive(x bool) CoreOption
func WithLeadTimeInHours ¶ added in v0.0.68
func WithLeadTimeInHours(x int64) CoreOption
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.