Documentation ¶
Overview ¶
Package mpdp observer User: 姜伟 Time: 2020-02-19 06:27:16
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISubject ¶
type ISubject interface { AddObservers(observers ...IObserver) // 添加观察者 ClearObservers() // 清空观察者 NotifyObservers(data interface{}) error // 通知观察者 }
ISubject 被观察者接口
type SubjectBasic ¶
type SubjectBasic struct {
Observers []IObserver
}
SubjectBasic 被观察者基础结构体
func (*SubjectBasic) AddObservers ¶
func (subject *SubjectBasic) AddObservers(observers ...IObserver)
AddObservers 添加观察者
func (*SubjectBasic) ClearObservers ¶
func (subject *SubjectBasic) ClearObservers()
ClearObservers 清空观察者
Click to show internal directories.
Click to hide internal directories.