notifier

package
v0.9.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 5 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)
}

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