fyi

package module
v0.0.0-...-a008f90 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: GPL-2.0 Imports: 0 Imported by: 0

README

FYI

FYI is a framework to create your own notification multiplexer.

Architecture

FYI uses concept of handlers for notifications, each notification has one or more handlers sorted by priority. When a notification arrives at the service, based on the request, and service configuration gets multiple handlers assigned to it, then handlers are sorted by priority and finally FYI starts executing the handlers.

Handlers

Handler can be any Go type that implements Handler interface which can be just a simple wrapper to another notification service or a complete implementation of a notification channel (SMS, Email, etc).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(Notification) (Response, error)

type Notification

type Notification struct {
	// is a map from name of each handler to the data
	// forexample { "sms": "+9899999", "email": "raskarpour@gmail.com" }
	Recipient map[string]string
	// Title, probably only some handlers support this
	Title string
	// Body of the notification
	Body string
}

type Response

type Response interface {
	Raw() (string, error)
}

Directories

Path Synopsis
cmd
fyi
pkg
mb

Jump to

Keyboard shortcuts

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