一个公共的通知中心服务,支持各类通知方式,包括邮件、短信、webhook、企业微信等。

Overview

NoticeServices 通用的通知服务

通用的通知服务支持web、webhook、短信、邮件、企业微信等通知消息的统一可配置管理与发送。支持通知模板、信息发送模板等配置。可以为多个业务应用提供通知消息发送服务。

支持功能:

  • 即时推送
  • 预约推送
  • 定期推送

支持多种发送通道:

  • 邮件
  • webhook (可配置多个)
  • web (http api接口方式)
  • 短信 (阿里云、腾讯云)
  • 企业微信

逻辑架构图

design01

技术栈

基础框架:GoFrame中文文档

数据库:SQLite 【 中文文档GO驱动使用 github.com/mattn/go-sqlite3接口文档

目录结构说明:

参考基础框架中的说明 【项目结构

公共通知服务API

通知数据

{
    "app_id":"dfasdfasdf",
    "config_id":"3eb5e3d5cd2c71ef6fce3f391c9eabcd",
    "come_from":"xxxadf",
    "method":"instant",
    "method_num":2,
    "method_task":"*",
    "msg_title":"3556777744系統故障了",
    "msg_body":"我们的内容信息",
    "msg_url":"http://www.aaa.com/aafd",
    "user_ids":"aaaa|bbbb|cccc",
    "party_ids":"",
    "totag":[{"name":"mail","value":"[email protected]"},{"name":"webhook","value":"cccc"}]
}

method:信息的任务方式,取值范围为:instant、appointment、regular

instant:即时发送 appointment:预约发送 regular:定期发送

使用说明

通知配置与模板配置

一个业务需要发送通知,需要在通知服务中创建一个通知配置。并配置这个通知采用哪儿些发送通道进行发送通知。并且针对选择的通道设置发信模板信息。

短信发送

发送内容如果是多个值的,msg_body中的内容要采用|分割。每个值对应短信模板中的可替换变量。

关于build.sh编译脚本

在使用build.sh脚本进行程序编译的时候,提示

fatal: No names found, cannot describe anything.
./build.sh linux|windows|mac

是因为源码没有进行git版本的标签设置。

支持将git的tag编译到程序中。需要创建git的tag。只有创建了tag,编译的程序才会显示版本号。

git tag v0.0.1

git push origin v0.0.1

感谢 JetBrains

JetBrains
You might also like...
The k8s-generic-webhook is a library to simplify the implementation of webhooks for arbitrary customer resources (CR) in the operator-sdk or controller-runtime.

k8s-generic-webhook The k8s-generic-webhook is a library to simplify the implementation of webhooks for arbitrary customer resources (CR) in the opera

Notification webhook for GoPhish

GoPhish Notifier GoPhish Notifier notifies red team members when their GoPhish campaign status has been updated. It supports both Slack and Email noti

(WIP) Extremely simple unixway GitHub webhook listener for push event

(WIP) puffy Puffy is an extremely simple unixway GitHub webhook listener and handler for push events Todo Add payload signature validation (WIP) Depen

an MDA that sends a webhook on recieval of mail

an MDA that sends a webhook on recieval of mail

Minimal go library to relay webhook events back to an arbitrary service.

hookrelay Minimal go library to relay webhook events back to an arbitrary service. With the use of a primary HTTP mux router, we are able to register

HSDP Metrics alerts webhook broker and CF events forwarder for Microsoft Teams

hsdp-events Microservice helper to translate HSDP Metrics webhooks to Microsoft Teams webhooks Configuration Environment Description EVENTS_TOKEN Rand

An easy to use relay for cftools webhook events piped to Discord when filter rules match.

CFTools Relay CFTools Relay is an easy-to-use, still in development, tool that allows you to subscribe to CFTools Cloud Webhook events and forward the

cert-manager webhook & CoreDNS plugin for solving DNS01 challenge on self-hosted authoritative DNS server.
cert-manager webhook & CoreDNS plugin for solving DNS01 challenge on self-hosted authoritative DNS server.

cert-manager webhook & CoreDNS plugin This repo exists for a niche case scenario in which we are running cert-manager on one or multiple Kubernetes cl

Slack Incoming Webhook for Go

Slack Incoming Webhook for Go Installation go get github.com/loyalid/slack-incoming-webhook-go Usage import "github.com/loyalid/slack-incoming-webhook

Feed pipe input into a Discord server via webhook.

Feed pipe input into a Discord server via webhook.

A webhook for performaning DNS01 validation against CoreDNS backended by etcd.

[WIP] cert-manager-webhook-coredns-etcd A webhook for performaning DNS01 validation against CoreDNS backended by etcd. Running the test suite All DNS

Benzinga Backend Challenge, A HTTP receiver and webhook forwarder

benzinga-backend-challenge Benzinga Backend Challenge, a simple webhook receiver and forwarder. The application should be a basic webhook receiver tha

The serverless OTP telegram service use telegram as OTP service, and send OTP through webhook

Setup OTP First thing, you need prepare API(webhook) with POST method, the payload format as below { "first_name": "Nolan", "last_name": "Nguyen",

This is a cert-manager webhook solver for DNSPod.

cert-manager-webhook-dnspod This is a cert-manager webhook solver for DNSPod. Prerequisites cert-manager = 1.6.0 Installation Generate SecretId and S

ACME Webhook for next layer DNS

ACME Webhook for next layer DNS This project provides a cert-manager ACME Webhook for next layer DNS and is based on the Example Webhook. Requirements

Example showing how to implement a basic mutating webhook

Kubernetes Mutating Webhook example This shows a basic implementation of a mutating webhook. Setup Note: This relies on TLS certificates to function c

Example Pod webhook

Pod Webhook Example Local Development # Create a local cluster. kind create cluster # Setup cluster dependencies (cert-manager). ./hack/setup.sh # D

Kubernetes Webhook used for image mutations

Table of Contents About Imagswap Getting Started Prerequisites Installation Usage Roadmap Contributing License Contact Acknowledgments About The Proje

Microservice we use to post reddit posts to a webhook

TypicalBot Reddit Webhook Poster Microservice we use to post reddit posts to a webhook. How to run The SHARED_API environment variable is to hook into

Comments
  • 创建webhook通知时error

    创建webhook通知时error

    image 0xffffffffffffffff fatal error: fault unexpected fault address 0xffffffffffffffff fatal error: fault [signal SIGSEGV: segmentation violation code=0x1 addr=0xffffffffffffffff pc=0xffffffffffffffff]

    goroutine 90 [running]: runtime.throw(0x488b4e9, 0x5) /usr/local/go/src/runtime/panic.go:1117 +0x72 fp=0xc000053c10 sp=0xc000053be0 pc=0x4038bf2 runtime.sigpanic() /usr/local/go/src/runtime/signal_unix.go:741 +0x276 fp=0xc000053c48 sp=0xc000053c10 pc=0x4050796 net/http.(*transferWriter).writeBody(0xc0004aa5a0, 0x495d740, 0xc00006c2c0, 0x0, 0x0) /usr/local/go/src/net/http/transfer.go:382 +0x356 fp=0xc000053d20 sp=0xc000053c48 pc=0x2f38ebd6 net/http.(*Request).write(0xc000144200, 0x495d740, 0xc00006c2c0, 0x0, 0xc0004b8420, 0x0, 0x0, 0x0) /usr/local/go/src/net/http/request.go:697 +0x7c6 fp=0xc000053ed8 sp=0xc000053d20 pc=0x2f382e26 net/http.(*persistConn).writeLoop(0xc0003b67e0)

    opened by wisonzhu 0
Owner
rain
rain
webhook is a lightweight incoming webhook server to run shell commands

What is webhook? webhook is a lightweight configurable tool written in Go, that allows you to easily create HTTP endpoints (hooks) on your server, whi

Adnan Hajdarević 8.5k Jan 5, 2023
A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers

k8s-vault-webhook is a Kubernetes admission webhook which listen for the events related to Kubernetes resources for injecting secret directly from sec

Opstree Container Kit 111 Oct 15, 2022
Kubernetes webhook development (validating admission webhook) tutorial using kubewebhook

pod-exec-guard-kubewebhook-tutorial Introduction This is a tutorial that shows how to develop a Kubernetes admission webhook. To explain this, the tut

Xabier Larrakoetxea Gallego 8 Aug 26, 2022
Tcpdump-webhook - Toy Sidecar Injection with Mutating Webhook

tcpdump-webhook A simple demonstration of Kubernetes Mutating Webhooks. Injects

Alp Kahvecioglu 2 Feb 8, 2022
Webhook-server - Webhook Server for KubeDB resources

webhook-server Webhook Server for KubeDB resources Installation To install KubeD

Kubernetes Database 1 Feb 22, 2022
:fishing_pole_and_fish: Webhook receiver for GitHub, Bitbucket, GitLab, Gogs

Library webhooks Library webhooks allows for easy receiving and parsing of GitHub, Bitbucket and GitLab Webhook Events Features: Parses the entire pay

Go Playgound 794 Jan 4, 2023
A simple way of sending messages from the CLI output to your Discord channel with webhook.

discat A simple way of sending messages from the CLI output to your Discord channel with webhook. Actually, this is a fork version of slackcat that I

dw1 32 Nov 15, 2022
Simple webhook delivery system powered by Golang and PostgreSQL

postmand Simple webhook delivery system powered by Golang and PostgreSQL. Features Simple rest api with only three endpoints (webhooks/deliveries/deli

Allisson Azevedo 20 Dec 22, 2022
🔑 Kubernetes Authentication & Authorization WebHook Server

Guard Guard by AppsCode is a Kubernetes Webhook Authentication server. Using guard, you can log into your Kubernetes cluster using various auth provid

Kubernetes Guard 546 Dec 16, 2022
A Kubernetes Mutating Webhook to automatically re-point pod images to mirrors

kubernetes-mimic Kubernetes Mimic is a Mutating Webhook that will watch for pod creation and update events in a Kubernetes cluster and automatically a

null 6 Nov 22, 2022