Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

AlexsJones/squawker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

squawker

Maintainability Go Report Card

A plug n play notifications system for golang

Example

func main() {

	
	notifierManager := notifier.NewManager(func(notifier notifier.INotifier, err error) {
			//Error handling
	})

	var notifiers = []notifier.INotifier{
		&stackdriver.Notifier{ProjectName: "PROJECT", LogID: "Logger0"},
		&slack.Notifier{ClientToken: "xoxp-TOKENNAME", Channels: []string{"CHANNEL"}},
		&victorops.Notifier{APIKey: "RestfulIntegrationKeyxxxx", RoutingKey: "production",
			EntityID: "XXX", MessageStatus: vo.Warning},
	}

	for _, noti := range notifiers {
		if err := notifierManager.AddNotifier(noti); err != nil {
			log.Fatal(err)
		}
	}

	notifierManager.SendFanOut("Warning", "THIS IS EVENT YOU ALL NEED TO KNOW ABOUT!")
}

Example using routing keys

package main

import (
	notifier "github.com/AlexsJones/squawker"
	"github.com/AlexsJones/squawker/services/slack"
	"github.com/AlexsJones/squawker/services/stackdriver"
	"github.com/AlexsJones/squawker/services/victorops"
	vo "github.com/chrissnell/victorops-go"
)

func main() {

	notifierManager := notifier.NewManager(func(notifier notifier.INotifier, err error) {
		//Error handling
	})

	var notifiers = map[string]notifier.INotifier{
		"Log":     &stackdriver.Notifier{ProjectName: "PROJECT", LogID: "Logger0"},
		"Warning": &slack.Notifier{ClientToken: "xoxp-TOKENNAME", Channels: []string{"CHANNEL"}},
		"Critical": &victorops.Notifier{APIKey: "RestfulIntegrationKeyxxxx", RoutingKey: "production",
			EntityID: "XXX", MessageStatus: vo.Warning},
	}

	notifierManager.AddNotifiersWithRoutingKeys(notifiers)

	notifierManager.SendFanOut("Warning", "This is an event some of you need to know about!")
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages