storeutil

package
v0.0.0-...-3654578 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package storeutil contains a ListenerRegistry type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListenerRegistry

type ListenerRegistry struct {
	// contains filtered or unexported fields
}

ListenerRegistry is a listener registry. The zero value is unfit for use; use NewListenerRegistry to create an instance.

func NewListenerRegistry

func NewListenerRegistry() *ListenerRegistry

NewListenerRegistry creates a listener registry.

func (*ListenerRegistry) Add

func (r *ListenerRegistry) Add(key interface{}, listener func())

Add adds listener with key to the registry. key may be nil, then an arbitrary unused key is assigned. It panics if a listener with same key is already present.

func (*ListenerRegistry) Fire

func (r *ListenerRegistry) Fire()

Fire invokes all listeners in the registry.

func (*ListenerRegistry) Remove

func (r *ListenerRegistry) Remove(key interface{})

Remove removes a listener with key from the registry.

Jump to

Keyboard shortcuts

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