This package serves as the beating heart of Guard.
It defines data structures that meet the v1alpha1 interface.
The v1alpha1 interface includes three interfaces:
- Profile: describing a sample of a data type
- Pile: accumulating multiple samples of a data type to enable learning.
- Config: the rules describing what is expected from the data type.
Per Sample:
- Profile.Profile(...sample...) - Create a profile from the sample
- Config.Decide(profile) - Decide if it conforms to the config rules
- Pile.Add(profile) - Add it to a pile.
Periodically:
- Pile.Merge(someOtherPile) - Merge someOtherPile to Pile.
- Config.Learn(pile) - Learn a new config rules based on a pile.
- Config.Fuse(someOtherConfig) - Fuse configs to form a new config from an old one.
Note:
- Profiles, Piles and Configs are build to be transportable across a distributed system.
Guard supports working in a distributed system by allowing many instances to collect samples and take decisions.
The instances each collect piles and send them to a central service that merge the piles and learn a new config based on the enw piles and the old config.
The config is then sent back to the instances and is kept in a persistent store.