notifier

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package for abstracting agent downstream updates and notifying upstream

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneList

func CloneList[T Clonable[T]](list []T) []T

Types

type AliasNotifer

type AliasNotifer[T Clonable[T]] updateNotifier[T]

type Clonable

type Clonable[T any] interface {
	Clone() T
}

type Finder

type Finder[T Clonable[T]] interface {
	Find(ctx context.Context) ([]T, error)
}

func NewMultiFinder added in v0.9.2

func NewMultiFinder[T Clonable[T]](finders ...Finder[T]) Finder[T]

type UpdateNotifier

type UpdateNotifier[T any] interface {
	// Returns a channel that will receive a list of update groups whenever
	// any rules are added, removed, or updated. The channel has a small buffer
	// and will initially contain the latest update group list.
	//
	// If the context is canceled, the channel will be closed. Additionally, if
	// the channel's buffer is full, any updates will be dropped.
	NotifyC(ctx context.Context) <-chan []T

	Refresh(ctx context.Context)
}

func NewPeriodicUpdateNotifier

func NewPeriodicUpdateNotifier[T Clonable[T]](ctx context.Context, finder Finder[T], interval time.Duration) UpdateNotifier[T]

func NewUpdateNotifier

func NewUpdateNotifier[T Clonable[T]](finder Finder[T]) UpdateNotifier[T]

Jump to

Keyboard shortcuts

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