webhookexporter

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 12 Imported by: 3

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
	// 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, logger *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