Documentation
¶
Overview ¶
Package options provides ways to extract the task-related options from a Flux script.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableScriptCacheForTest ¶
func EnableScriptCacheForTest()
EnableScriptCacheForTest is used as a workaround for https://github.com/influxdata/platform/issues/484, and should be removed after that issue is addressed. Do not call this method in production code, as it will leak memory.
Types ¶
type Options ¶
type Options struct { // Name is a non optional name designator for each task. Name string `json:"options,omitempty"` // Cron is a cron style time schedule that can be used in place of Every. Cron string `json:"cron,omitempty"` // Every represents a fixed period to repeat execution. // this can be unmarshaled from json as a string i.e.: "1d" will unmarshal as 1 day Every time.Duration `json:"every,omitempty"` // Offset represents a delay before execution. // this can be unmarshaled from json as a string i.e.: "1d" will unmarshal as 1 day Offset time.Duration `json:"offset,omitempty"` Concurrency int64 `json:"concurrency,omitempty"` Retry int64 `json:"retry,omitempty"` }
Options are the task-related options that can be specified in a Flux script.
func FromScript ¶
FromScript extracts Options from a Flux script.
func (*Options) Clear ¶
func (o *Options) Clear()
Clear clears out all options in the options struct, it us useful if you wish to reuse it.
func (*Options) EffectiveCronString ¶
EffectiveCronString returns the effective cron string of the options. If the cron option was specified, it is returned. If the every option was specified, it is converted into a cron string using "@every". Otherwise, the empty string is returned. The value of the offset option is not considered.