Documentation ¶
Index ¶
- func GetAllNotifications() map[string]map[string]map[string]Config
- func GetProductNotifications(team, product string) map[string]Config
- func GetTeamNotifications(team string) map[string]map[string]Config
- func MatchesPattern(pattern *regexp.Regexp) validator.Func
- type Config
- type ConfigTree
- func (t ConfigTree) GetAllNotifications() map[string]map[string]map[string]Config
- func (t ConfigTree) GetNotification(team, product, id string) (Config, bool)
- func (t ConfigTree) GetProductNotifications(team, product string) map[string]Config
- func (t ConfigTree) GetProducts(team string) []string
- func (t ConfigTree) GetTeamNotifications(team string) map[string]map[string]Config
- func (t ConfigTree) GetTeams() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllNotifications ¶
GetAllNotifications returns all notifications loaded from the data directory within this package as a native map.
func GetProductNotifications ¶
GetTeamNotifications returns all notifications loaded from the data directory within this package for a particular team and product as a native map.
func GetTeamNotifications ¶
GetTeamNotifications returns all notifications loaded from the data directory within this package for a particular team as a native map.
func MatchesPattern ¶ added in v0.2.4
Types ¶
type Config ¶
type Config struct { Description string `validate:"required,ends-with-alnum"` InternalOnly bool `yaml:"internalOnly"` ServiceName string `yaml:"serviceName"` Severity string `validate:"required,oneof=Debug Error Fatal Info Warning"` Summary string `validate:"required"` }
Config abstracts configuration values for a customer notification. Any changes to this struct should be updated in './data/README.md'.
func GetNotification ¶
GetNotification returns a Config and the value 'true' if a config exists for the given combination of 'team', 'product' and 'id' from the data directory within this package. Otherwise, an empty Config value is returned along with 'false'.
func (*Config) ProvideRowData ¶ added in v0.2.2
func (*Config) UnmarshalYAML ¶
type ConfigTree ¶
ConfigTree abstracts notification configs loaded from a filesystem.
func (ConfigTree) GetAllNotifications ¶
func (t ConfigTree) GetAllNotifications() map[string]map[string]map[string]Config
GetAllNotifications returns a copy of the ConfigTree in native values.
func (ConfigTree) GetNotification ¶
func (t ConfigTree) GetNotification(team, product, id string) (Config, bool)
GetNotification returns a Config and the value 'true' if a config exists for the given combination of 'team', 'product' and 'id'. Otherwise, an empty Config value is returned along with 'false'.
func (ConfigTree) GetProductNotifications ¶
func (t ConfigTree) GetProductNotifications(team, product string) map[string]Config
GetProductNotifications returns a map from id -> Config for all notifications related to a team and product.
func (ConfigTree) GetProducts ¶
func (t ConfigTree) GetProducts(team string) []string
GetProducts returns a slice of products for a particular team from a ConfigTree.
func (ConfigTree) GetTeamNotifications ¶
func (t ConfigTree) GetTeamNotifications(team string) map[string]map[string]Config
GetTeamNotifications returns a sub-tree for a particular team in native values.
func (ConfigTree) GetTeams ¶
func (t ConfigTree) GetTeams() []string
GetTeams returns a slice of teams from a ConfigTree.