parser

package
v0.0.0-...-3934c66 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is responsible for parsing the CTF string and assign the right variables such as Interval and the Date to the Parser. Now each task is assigned a Parser meaning that a parser is always present for the scheduler to ask for the Interval and date variables inside the struct.

This design decision is intentional and it is used to rebuild the task from the cloak bolt db database.

func (*Parser) GetDate

func (p *Parser) GetDate() time.Time

func (*Parser) GetDays

func (p *Parser) GetDays() []int

func (*Parser) GetInterval

func (p *Parser) GetInterval() time.Duration

func (*Parser) GetNextAllowedDay

func (p *Parser) GetNextAllowedDay() int

func (Parser) New

func (p Parser) New(ctf string) *Parser

New ..

func (*Parser) Parse

func (p *Parser) Parse() error

Parse will trigger the parsing of the CTF passed while creating new instance of parser

func (*Parser) SetDate

func (p *Parser) SetDate(t time.Time)

func (*Parser) SetInterval

func (p *Parser) SetInterval(i time.Duration)

func (*Parser) SetNextDate

func (p *Parser) SetNextDate(a int) int

SetNextDate checks the differnce between today's day and the next allowed day component

Jump to

Keyboard shortcuts

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