Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNestedMap ¶
func GetNestedMap[K1, K2 comparable, V any, M ~map[K2]V](m map[K1]M, k K1) M
GetNestedMap is a utility function for nested maps. It will create the map at the given key if it does not already exist, then returns the corresponding map.
Types ¶
type RawResourceHandler ¶
type RawResourceHandler interface { // AllSubscriptions returns a sequence of all the subscriptions in this client. AllSubscriptions() iter.Seq[string] // HandleResponses should be called whenever responses are received. Accepts a slice of responses, // since the client may support chunking. The given boolean parameter indicates whether this is the // set of responses received for a stream. This is used to determine whether any resources were // deleted while the client was disconnected. HandleResponses(isFirst bool, responses []*ads.DeltaDiscoveryResponse) error }
RawResourceHandler is a non-generic interface implemented by ResourceHandler. Used by the non-generic github.com/linkedin/diderot.ADSClient.
type ResourceHandler ¶
ResourceHandler implements the core logic of managing notifications for watchers.
func NewResourceHandler ¶
func NewResourceHandler[T proto.Message]() *ResourceHandler[T]
func (*ResourceHandler[T]) AddWatcher ¶
func (h *ResourceHandler[T]) AddWatcher(name string, w Watcher[T]) bool
AddWatcher registers the given Watcher against the given resource name. The watcher will be notified whenever the resource is created, updated or deleted. The returned boolean indicates whether the watcher was a new registration, or was already previously registered. If a value for the given resource is already known, the watcher is immediately notified.
func (*ResourceHandler[T]) AllSubscriptions ¶
func (h *ResourceHandler[T]) AllSubscriptions() iter.Seq[string]
func (*ResourceHandler[T]) HandleResponses ¶
func (h *ResourceHandler[T]) HandleResponses(isFirst bool, responses []*ads.DeltaDiscoveryResponse) error