nurse/grammar/grammar.go
Peter Kurfer 4c2aa968d2
Implement config reading
- support config file
- support reading checks, server definition and endpoint definitions from env
2022-05-08 11:00:22 +02:00

20 lines
390 B
Go

package grammar
type Call struct {
Module string `parser:"(@Module'.')?"`
Name string `parser:"@Ident"`
Params []Param `parser:"'(' @@? ( ',' @@ )*')'"`
}
type Filters struct {
Chain []Call `parser:"@@ ('->' @@)*"`
}
type Check struct {
Initiator *Call `parser:"@@"`
Validators *Filters `parser:"( '=>' @@)?"`
}
type Script struct {
Checks []Check `parser:"(@@';'?)*"`
}