Skip to content

Custom Notifier

To create a custom notifier you must have a struct that implements the notifier.Notifier interface.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import (
    ffclient "github.com/thomaspoignant/go-feature-flag"
    "github.com/thomaspoignant/go-feature-flag/notifier/notifier"
    "sync"
)

type Notifier struct{}
func (c *Notifier) Notify(diff notifier.DiffCache, wg *sync.WaitGroup) error {
    defer waitGroup.Done() // don't forget this line, if you don't have it you can break your notifications

    // ...
    // do whatever you want here
}