Commit Graph

1 Commits

Author SHA1 Message Date
Paul Stemmet c1afc0d510
config: WatchConfig, WatchRules
These are representations of user defined rules and contextual
information, which can be used to handle notify events.

Specifically, we allow this user to provide (and later access via .Cxt)
arbitrary data under the watch.context key, while providing us rules
under watch.rules.

Each rule consists of an 'Exec' template, and three conditions for
running it (State, Type, Instance). Omitted conditions are ignored.

The Exec value consists of a golang templated command to be executed
based on the conditions listed above.

It has access to two keys, '.Event', and '.Cxt'. .Event contains the
'.Instance', '.State' and '.Type' of the event which triggered this
Exec, while '.Cxt' refers to the arbitrary watch.context passed in.
2022-12-09 18:05:57 +00:00