activation

package
v0.0.310 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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

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 (c *Core) GetAutoStart() bool

func (*Core) GetIsActive

func (c *Core) GetIsActive() bool

func (*Core) GetLeadTimeInHours added in v0.0.68

func (c *Core) GetLeadTimeInHours() int64

func (*Core) SetAutoStart

func (c *Core) SetAutoStart(x bool)

func (*Core) SetIsActive

func (c *Core) SetIsActive(x bool)

func (*Core) SetLeadTimeInHours added in v0.0.68

func (c *Core) SetLeadTimeInHours(x int64)

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]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL