Notifier is the instance being observed. Publisher is perhaps another decent name, but naming things is hard.
| 26 | // Notifier is the instance being observed. Publisher is perhaps another decent |
| 27 | // name, but naming things is hard. |
| 28 | Notifier interface { |
| 29 | // Register allows an instance to register itself to listen/observe |
| 30 | // events. |
| 31 | Register(Observer) |
| 32 | // Deregister allows an instance to remove itself from the collection |
| 33 | // of observers/listeners. |
| 34 | Deregister(Observer) |
| 35 | // Notify publishes new events to listeners. The method is not |
| 36 | // absolutely necessary, as each implementation could define this itself |
| 37 | // without losing functionality. |
| 38 | Notify(Event) |
| 39 | } |
| 40 | ) |
| 41 | |
| 42 | type ( |
nothing calls this directly
no outgoing calls
no test coverage detected