Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassMonitor ¶
type ClassMonitor struct {
// contains filtered or unexported fields
}
ClassMonitor stands for observer
func (*ClassMonitor) AddListener ¶
func (c *ClassMonitor) AddListener(listener StudentListener)
AddListener add StudentListener into list
func (*ClassMonitor) Notify ¶
func (c *ClassMonitor) Notify()
Notify send notification to all listeners
func (*ClassMonitor) RemoveListener ¶
func (c *ClassMonitor) RemoveListener(listener StudentListener)
RemoveListener remove StudentListener from list
type Informer ¶
type Informer struct {
// contains filtered or unexported fields
}
Informer stands for concrete Listener
type Listener ¶
type Listener interface { Title() string GetName() string GetParty() string OnBeFighted(event *Event) }
Listener of abstract Event
type Notifier ¶
type Notifier interface { Attach(listener Listener) Detach(listener Listener) Notify(event *Event) }
Notifier of abstract Event
type StudentListener ¶
type StudentListener interface {
OnTeacherComming()
}
StudentListener of abstract Listener
type StudentNotifier ¶
type StudentNotifier interface { Notify() AddListener(l StudentListener) RemoveListener(l StudentListener) }
StudentNotifier of abstract Notifier
Click to show internal directories.
Click to hide internal directories.