webhooknotifier

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	// EndpointURL of your webhook
	EndpointURL string

	// Optional: Secret used to sign your request body.
	Secret string

	// 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
	// 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, wg *sync.WaitGroup) error

Jump to

Keyboard shortcuts

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