webhookexporter

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

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

Exporter is the exporter of your data to a webhook. It calls the EndpointURL with a POST request with the following format:

{
   "meta": {
     "hostname": "server01",
   },
   "events": [
     {
        "kind": "feature",
        "contextKind": "anonymousUser",
        "userKey": "14613538188334553206",
        "creationDate": 1618909178,
        "key": "test-flag",
        "variation": "Default",
        "value": false,
        "default": false
     },
   ]
 }

func (*Exporter) Export

func (f *Exporter) Export(ctx context.Context, _ *log.Logger, featureEvents []exporter.FeatureEvent) error

Export is sending a collection of events in a webhook call.

func (*Exporter) IsBulk

func (f *Exporter) IsBulk() bool

IsBulk return false if we should directly send the data as soon as it is produce and true if we collect the data to send them in bulk.

Jump to

Keyboard shortcuts

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