options

package
v0.0.0-...-d500d3c Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 8 Imported by: 0

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

	// Cron is a cron style time schedule that can be used in place of Every.
	Cron string

	// Every represents a fixed period to repeat execution.
	Every time.Duration

	// Offset represents a delay before execution.
	Offset time.Duration

	Concurrency int64

	Retry int64
}

Options are the task-related options that can be specified in a Flux script.

func FromScript

func FromScript(script string) (Options, error)

FromScript extracts Options from a Flux script.

func (*Options) EffectiveCronString

func (o *Options) EffectiveCronString() string

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.

func (*Options) Validate

func (o *Options) Validate() error

Validate returns an error if the options aren't valid.

Jump to

Keyboard shortcuts

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