Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observer ¶
type Observer interface {
Notify(string)
}
Observer interface declares the method to notify all subscribers
type Publisher ¶
type Publisher struct {
ObserversList []Observer
}
Publisher contains a list of observer to spread an message
func (*Publisher) AddObserver ¶
AddObserver adds an observer into ObserversList
func (*Publisher) NotifyObservers ¶
NotifyObservers notifies all observers about a message
func (*Publisher) RemoveObserver ¶
RemoveObserver removes an observer from ObserversList
Click to show internal directories.
Click to hide internal directories.