Send (generic/generic.go)

shoutrrr · pkg/services/generic/generic.go · go · MIT
integration, Integration / API

Generic webhook sender for sending messages to any HTTP endpoint.

// Source: https://github.com/containrrr/shoutrrr | License: MIT | Copyright 2019 Containrrr
// Provided via justclaw.it.com; keep this notice with the code.
package generic

import (
	"encoding/json"
	"github.com/containrrr/shoutrrr/pkg/format"
	"github.com/containrrr/shoutrrr/pkg/services/standard"
	"github.com/containrrr/shoutrrr/pkg/types"

	"bytes"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"strings"
)

// Service providing a generic notification service
type Service struct {
	standard.Standard
	config *Config
	pkr    format.PropKeyResolver
}

// Send a notification message to a generic webhook endpoint
func (service *Service) Send(message string, paramsPtr *types.Params) error {
	config := *service.config

	var params types.Params
	if paramsPtr == nil {
		params = types.Params{}
	} else {


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key