parser

package
v1.0.194 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingId                    = errors.New("missing id")
	ErrMissingServiceTaskDefinition = errors.New("missing service task definition")
)

Functions

func Parse

func Parse(name string, rdr io.Reader) (*model.Workflow, error)

Types

type Duration added in v0.1.74

type Duration struct {
	Y int
	M int
	W int
	D int
	// Time Component
	TH int
	TM int
	TS int
}

Duration represents an ISO8601 Duration https://en.wikipedia.org/wiki/ISO_8601#Durations

func ParseISO8601 added in v0.1.74

func ParseISO8601(from string) (Duration, error)

ParseISO8601 parses an ISO8601 duration string.

func (Duration) HasTimePart added in v0.1.74

func (d Duration) HasTimePart() bool

HasTimePart returns true if the time part of the duration is non-zero.

func (Duration) IsZero added in v0.1.74

func (d Duration) IsZero() bool

IsZero reports whether d represents the zero duration, P0D.

func (Duration) Shift added in v0.1.74

func (d Duration) Shift(t time.Time) time.Time

Shift returns a time.Time, shifted by the duration from the given start.

NB: Shift uses time.AddDate for years, months, weeks, and days, and so shares its limitations. In particular, shifting by months is not recommended unless the start date is before the 28th of the month. Otherwise, dates will roll over, e.g. Aug 31 + P1M = Oct 1.

Week and Day values will be combined as W*7 + D.

type ParserError added in v0.1.175

type ParserError struct {
	Err     error
	Context string
}

func (ParserError) Error added in v0.1.175

func (e ParserError) Error() string

Jump to

Keyboard shortcuts

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