Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserLogin ¶
type UserLogin struct{}
UserLogin是要被代理的类,它需要加入一些额外的功能,比如缓存、鉴权等非业务核心逻辑相关的功能,可以交给代理类实现
type UserLoginProxy1 ¶
type UserLoginProxy1 struct {
UserLogin
}
UserLoginProxy1 基于继承的方式的代理。由于Go没有继承的,因此可以使用嵌入的方式模拟继承
type UserLoginProxy2 ¶
type UserLoginProxy2 struct {
// contains filtered or unexported fields
}
基于组合的代理模式
Click to show internal directories.
Click to hide internal directories.