notification

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllNotifications

func GetAllNotifications() map[string]map[string]map[string]Config

GetAllNotifications returns all notifications loaded from the data directory within this package as a native map.

func GetProductNotifications

func GetProductNotifications(team, product string) map[string]Config

GetTeamNotifications returns all notifications loaded from the data directory within this package for a particular team and product as a native map.

func GetTeamNotifications

func GetTeamNotifications(team string) map[string]map[string]Config

GetTeamNotifications returns all notifications loaded from the data directory within this package for a particular team as a native map.

Types

type Config

type Config struct {
	Description  string
	InternalOnly bool
	ServiceName  string
	Severity     string
	Summary      string
}

Config abstracts configuration values for a customer notification. Any changes to this struct should be updated in './data/README.md'.

func GetNotification

func 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' from the data directory within this package. Otherwise, an empty Config value is returned along with 'false'.

func (*Config) ToRow

func (c *Config) ToRow() output.Row

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

type ConfigTree

type ConfigTree map[string]map[string]map[string]Config

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL