MCPcopy Create free account
hub / github.com/github/gh-aw / parse

Method parse

pkg/parser/schedule_parser.go:78–90  ·  view source on GitHub ↗

parse parses the tokens into a cron expression

()

Source from the content-addressed store, hash-verified

76
77// parse parses the tokens into a cron expression
78func (p *ScheduleParser) parse() (string, error) {
79 if len(p.tokens) == 0 {
80 return "", errors.New("no tokens to parse")
81 }
82
83 // Check for interval-based schedules: "every N minutes|hours"
84 if p.tokens[0] == "every" {
85 return p.parseInterval()
86 }
87
88 // Otherwise, parse as base schedule (daily, weekly, monthly, yearly)
89 return p.parseBase()
90}
91
92// parseInterval parses interval-based schedules like "every 10 minutes" or "every 2h"
93func (p *ScheduleParser) parseInterval() (string, error) {

Calls 2

parseIntervalMethod · 0.95
parseBaseMethod · 0.95

Tested by 6

parsePayloadOutputFunction · 0.36
makeFetchResponseFunction · 0.36
mockRequireFunction · 0.36
makeRequestFunction · 0.36
runHarnessWithStubFunction · 0.36
getJsonLdFunction · 0.36