webhooknotifier

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {

	// Meta (optional) information that you want to send to your webhook
	Meta map[string]string
	// Headers (optional) the list of Headers to send to the endpoint
	Headers map[string][]string
	// EndpointURL of your webhook
	EndpointURL string
	// Optional: Secret used to sign your request body.
	Secret string
	// contains filtered or unexported fields
}

Notifier will call your endpoint URL with a POST request with the following format

{
  "meta": {
    "hostname": "server01"
  },
  "flags": {
    "deleted": {
      "test-flag": {
        "rule": "key eq \"random-key\"",
        "percentage": 100,
        "true": true,
        "false": false,
        "default": false
      }
    },
    "added": {
      "test-flag3": {
        "percentage": 5,
        "true": "test",
        "false": "false",
        "default": "default"
      }
    },
    "updated": {
      "test-flag2": {
        "old_value": {
          "rule": "key eq \"not-a-key\"",
          "percentage": 100,
          "true": true,
          "false": false,
          "default": false
        },
        "new_value": {
          "disable": true,
          "rule": "key eq \"not-a-key\"",
          "percentage": 100,
          "true": true,
          "false": false,
          "default": false
        }
      }
    }
  }
}

func (*Notifier) Notify

func (c *Notifier) Notify(diff notifier.DiffCache) error

Notify is the notifying all the changes to the notifier.

Jump to

Keyboard shortcuts

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