MCPcopy Create free account

hub / github.com/bytexlee/go-patterns / types & classes

Types & classes107 in github.com/bytexlee/go-patterns

InterfaceActionState
因为含有多种状态,状态类型不确定,这里需要声明State接口,多态原则
14-state-pattern/state.go:45
StructAddExpression
加法表达式
26-interpreter-pattern/interpreter.go:26
StructAddition
Addition struct inherit Operator
08-strategy-pattern/strategy.go:17
StructAnalysis
18-iterator-pattern/iterator.go:49
StructApple
Apple结构体
21-bridge-pattern/bridge.go:34
StructAppleDecorator
装饰结构体
05-decorator-pattern/decorator.go:25
StructBoy
定义具体子类,且实现具体的action
20-template-method-pattern/template_method.go:33
InterfaceBuilder
builder interface
01-builder-patterns/builder.go:13
StructCar
car struct
01-builder-patterns/builder.go:34
StructCaretaker
*创建管理者Caretaker*/ 实现创建备忘录和恢复发起者状态方法
24-memento-pattern/memento.go:43
StructCashPay
实现两个struct,继承接口Payment
02-factory-method-patterns/factory_method.go:17
StructCircle
创建circle,实现shape方法
17-flyweight-pattern/flyweight.go:10
StructClosedState
Closed State
14-state-pattern/state.go:81
InterfaceCommand
*创建Command接口*/
23-command-pattern/command.go:26
InterfaceComponent
05-decorator-pattern/decorator.go:5
StructConCreteFactory
具体工厂
11-abstract-factory/abstract_factory.go:25
StructConcreteCommandA
创建具体command, 指定接收者
23-command-pattern/command.go:31
StructConcreteCommandB
23-command-pattern/command.go:39
StructConcreteProduct
具体的产品
11-abstract-factory/abstract_factory.go:16
StructContainer
创建容器
18-iterator-pattern/iterator.go:26
StructContext
context对象,根据HealthValue的不同值设置不同状态
14-state-pattern/state.go:6
StructCount
count struct
19-facade-pattern/facade.go:22
StructCpu
具体类型CPU和Storage
21-bridge-pattern/bridge.go:11
StructCreditPay
02-factory-method-patterns/factory_method.go:21
StructDirector
Director
01-builder-patterns/builder.go:21
TypeAliasEagerVisitorList
将多个[]Visitor封装为一个Visitor
15-visitor-pattern/visitor.go:26
StructEvent
22-chain-of-responsibility-pattern/chain.go:57
StructEvent
定义事件结构体
07-observer-pattern/observer.go:6
StructExample
16-prototype-pattern/prototype.go:3
InterfaceExpression
定义接口表达式
26-interpreter-pattern/interpreter.go:9
StructFacade
外观结构Facade
19-facade-pattern/facade.go:33
InterfaceFactory
11-abstract-factory/abstract_factory.go:7
StructFruit
基础结构体
05-decorator-pattern/decorator.go:11
StructGamePlayer
在音乐播放基础上实现游戏播放 定义游戏结构体
12-adapter-pattern/adapter.go:25
StructGamePlayerAdapter
这里要实现调用play方法的时候,实现GamePlayer的播放 通过组合的方式,声明一个Game的适配器
12-adapter-pattern/adapter.go:36
StructGirl
20-template-method-pattern/template_method.go:42
StructHuaWei
HuaWei结构体
21-bridge-pattern/bridge.go:47
InterfaceIDepartment
创建IDepartment接口
25-mediator-pattern/mediator.go:27
InterfaceIObject
1.use proxy and object they must implement same methods
06-proxy-pattern/proxy.go:6
StructInfo
15-visitor-pattern/visitor.go:8
InterfaceInterface
定义Interface
22-chain-of-responsibility-pattern/chain.go:6
InterfaceInterface
09-semaphore-pattern/semaphore.go:13
StructInvestorObserver
通过具体对象来实现接口 投资人观察者
07-observer-pattern/observer.go:23
StructInvoker
*创建请求对象, 维护请求cmd*/
23-command-pattern/command.go:48
StructIterator
创建迭代器
18-iterator-pattern/iterator.go:6
TypeAliasKind
02-factory-method-patterns/factory_method.go:5
StructMarket
创建具体 Market Department
25-mediator-pattern/mediator.go:46
StructMediator
创建Mediator
25-mediator-pattern/mediator.go:6
StructMemento
*创建Memento struct*/ 属性可以为state,或Originator对象
24-memento-pattern/memento.go:29
StructMenu
Menu结构体
13-composite-pattern/composite.go:68
InterfaceMenuComponent
接下来实现Menu struct, Menu包含共同部分MenuDesc以及列表, 将列表部分分离出来 * MenuGroup, 这里引入接口MenuComponent, 因为child类型是不确定的 此外,由于接口为Menu和MenuItem的共同接口,所以包含Price和Print方法 */
13-composite-pattern/composite.go:48
StructMenuDesc
抽离共同属性部分
13-composite-pattern/composite.go:6
StructMenuGroup
13-composite-pattern/composite.go:52
StructMenuItem
MenuItem组合,继承了MenuDesc的方法
13-composite-pattern/composite.go:19
StructMultiplication
Multiplication struct
08-strategy-pattern/strategy.go:24
StructMusic
music struct
19-facade-pattern/facade.go:4
StructMusicPlayer
12-adapter-pattern/adapter.go:10
StructNormalState
* 具体的状态,继承接口 */ Normal state
14-state-pattern/state.go:55
InterfaceNotifier
07-observer-pattern/observer.go:15
StructNumExpression
实现具体的类 整数表达式
26-interpreter-pattern/interpreter.go:16
FuncTypeObject
func(int) int
05-decorator-pattern/decorator_wrap_func.go:5
StructObject
03-object-pool-pattern/object_pool.go:5
StructObject
2.object represents real objects which proxy will delegate data
06-proxy-pattern/proxy.go:11
StructObjectA
定义ObjectA struct
22-chain-of-responsibility-pattern/chain.go:12
StructObjectB
定义ObjectB struct
22-chain-of-responsibility-pattern/chain.go:35
InterfaceObserver
设计观察者和被观察者接口
07-observer-pattern/observer.go:11
StructOperation
包装器
08-strategy-pattern/strategy.go:8
InterfaceOperator
08-strategy-pattern/strategy.go:3
StructOriginator
* 跟原型模式有些相识 设计思想: 1. 发起人角色 Originator: 记录当前的内部状态, 负责创建和恢复备忘录数据 2. 备忘录角色 Memento : 存储发起人对象的内部状态 3. 管理者角色 Caretaker: 负责保存备忘录对象 *代码上实现逻辑: 通过
24-memento-pattern/memento.go:15
StructP
main.go:5
StructParser
定义解析器
26-interpreter-pattern/interpreter.go:46
InterfacePayment
02-factory-method-patterns/factory_method.go:12
StructPerson
定义父类Person
20-template-method-pattern/template_method.go:13
StructPhone
桥接层结构体
21-bridge-pattern/bridge.go:24
InterfacePlayer
音乐播放器
12-adapter-pattern/adapter.go:6
TypeAliasPool
03-object-pool-pattern/object_pool.go:9
InterfaceProduct
11-abstract-factory/abstract_factory.go:11
StructProxyObject
ProxyObject represent proxy object with intercepts actions
06-proxy-pattern/proxy.go:21
StructPublisher
27-publish-and-subscribe/pubsub.go:13
InterfaceReceiver
*创建Receiver, 这里使用接口,为了实现多个receiver。(可以创建Receiver struct)*/
23-command-pattern/command.go:6
StructReceiverA
创建具体的接收者,实现接口方法
23-command-pattern/command.go:11
StructReceiverB
23-command-pattern/command.go:18
StructRestrictedState
Restricted State
14-state-pattern/state.go:68
StructSemaphore
定义结构体, 信号量使用chan struct{}
09-semaphore-pattern/semaphore.go:19
InterfaceShape
创建shape接口
17-flyweight-pattern/flyweight.go:4
InterfaceShape
定义接口
20-template-method-pattern/template_method.go:6
StructShapeFactory
创建ShapeFactory
17-flyweight-pattern/flyweight.go:24
StructShareNotifier
股票被观察者
07-observer-pattern/observer.go:32
InterfaceSoftWare
抽象接口
21-bridge-pattern/bridge.go:6
StructStorage
21-bridge-pattern/bridge.go:17
StructStreamVisitor
15-visitor-pattern/visitor.go:48
StructSubExpression
减法表达式
26-interpreter-pattern/interpreter.go:36
TypeAliasTYPE
使用工厂方法模式来创建ConcreteCommand
23-command-pattern/command.go:69
StructTeacher
创建具体的visitor对象
18-iterator-pattern/iterator.go:47
StructTechnical
创建具体 Technical Department
25-mediator-pattern/mediator.go:33
StructURLVisitor
url visit
15-visitor-pattern/visitor.go:66
StructVehicle
定义父struct
01-builder-patterns/builder.go:6
StructVideo
Video struct
19-facade-pattern/facade.go:13
InterfaceVisitor
visitor 接口
15-visitor-pattern/visitor.go:18
InterfaceVisitor
创建Visitor接口
18-iterator-pattern/iterator.go:42
next →1–100 of 107, ranked by callers