Documentation ¶
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) Has ¶
func (r *ListenerRegistry) Has(key interface{}) bool
Has returns true if the listener registry has a listener with the given key
func (*ListenerRegistry) Remove ¶
func (r *ListenerRegistry) Remove(key interface{})
Remove removes a listener with key from the registry.
Click to show internal directories.
Click to hide internal directories.