notifier

package
v2.34.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyToEtcdNotifier

type KeyToEtcdNotifier struct {
	notifiers.KeyBase
	// contains filtered or unexported fields
}

KeyToEtcdNotifier holds the state of a notifier that writes raw/transformed contents of a watched key to another key in etcd.

func NewKeyToEtcdNotifier

func NewKeyToEtcdNotifier(
	key notifiers.Key,
	etcdPath string,
	etcdClient *etcdclient.Client,
	withLease bool,
) (*KeyToEtcdNotifier, error)

NewKeyToEtcdNotifier returns a new notifier that writes raw/transformed contents to etcd at "etcdPath/key".

func (*KeyToEtcdNotifier) Notify

func (ken *KeyToEtcdNotifier) Notify(event notifiers.Event)

Notify writes/removes to etcd based on received event.

func (*KeyToEtcdNotifier) Start

func (ken *KeyToEtcdNotifier) Start() error

Start starts the key notifier.

func (*KeyToEtcdNotifier) Stop

func (ken *KeyToEtcdNotifier) Stop() error

Stop stops the key notifier.

type PrefixToEtcdNotifier

type PrefixToEtcdNotifier struct {
	notifiers.PrefixBase
	// contains filtered or unexported fields
}

PrefixToEtcdNotifier holds the state of a notifier that writes raw/transformed contents of a watched prefix to etcd.

func NewPrefixToEtcdNotifier

func NewPrefixToEtcdNotifier(
	etcdPath string,
	etcdClient *etcdclient.Client,
) *PrefixToEtcdNotifier

NewPrefixToEtcdNotifier returns a new prefix notifier that writes raw/transformed contents to etcd at "etcdPath/key".

func (*PrefixToEtcdNotifier) GetKeyNotifier

func (pen *PrefixToEtcdNotifier) GetKeyNotifier(key notifiers.Key) (notifiers.KeyNotifier, error)

GetKeyNotifier gets the underlying key notifier from prefix notifier.

func (*PrefixToEtcdNotifier) Start

func (pen *PrefixToEtcdNotifier) Start() error

Start starts the prefix notifier.

func (*PrefixToEtcdNotifier) Stop

func (pen *PrefixToEtcdNotifier) Stop() error

Stop stops the prefix notifier.

Jump to

Keyboard shortcuts

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