SYMBOL INDEX (322 symbols across 48 files) FILE: 00_simple_factory/simple.go type API (line 6) | type API interface function NewAPI (line 11) | func NewAPI(t int) API { type hiAPI (line 21) | type hiAPI struct method Say (line 24) | func (*hiAPI) Say(name string) string { type helloAPI (line 29) | type helloAPI struct method Say (line 32) | func (*helloAPI) Say(name string) string { FILE: 00_simple_factory/simple_test.go function TestType1 (line 6) | func TestType1(t *testing.T) { function TestType2 (line 14) | func TestType2(t *testing.T) { FILE: 01_facade/facade.go function NewAPI (line 5) | func NewAPI() API { type API (line 13) | type API interface type apiImpl (line 18) | type apiImpl struct method Test (line 23) | func (a *apiImpl) Test() string { function NewAModuleAPI (line 30) | func NewAModuleAPI() AModuleAPI { type AModuleAPI (line 35) | type AModuleAPI interface type aModuleImpl (line 39) | type aModuleImpl struct method TestA (line 41) | func (*aModuleImpl) TestA() string { function NewBModuleAPI (line 46) | func NewBModuleAPI() BModuleAPI { type BModuleAPI (line 51) | type BModuleAPI interface type bModuleImpl (line 55) | type bModuleImpl struct method TestB (line 57) | func (*bModuleImpl) TestB() string { FILE: 01_facade/facade_test.go function TestFacadeAPI (line 8) | func TestFacadeAPI(t *testing.T) { FILE: 02_adapter/adapter.go type Target (line 4) | type Target interface type Adaptee (line 9) | type Adaptee interface function NewAdaptee (line 14) | func NewAdaptee() Adaptee { type adapteeImpl (line 19) | type adapteeImpl struct method SpecificRequest (line 22) | func (*adapteeImpl) SpecificRequest() string { function NewAdapter (line 27) | func NewAdapter(adaptee Adaptee) Target { type adapter (line 34) | type adapter struct method Request (line 39) | func (a *adapter) Request() string { FILE: 02_adapter/adapter_test.go function TestAdapter (line 7) | func TestAdapter(t *testing.T) { FILE: 03_singleton/singleton.go type Singleton (line 7) | type Singleton interface type singleton (line 12) | type singleton struct method foo (line 14) | func (s singleton) foo() {} function GetInstance (line 22) | func GetInstance() Singleton { FILE: 03_singleton/singleton_test.go constant parCount (line 8) | parCount = 100 function TestSingleton (line 10) | func TestSingleton(t *testing.T) { function TestParallelSingleton (line 18) | func TestParallelSingleton(t *testing.T) { FILE: 04_factory_method/factorymethod.go type Operator (line 4) | type Operator interface type OperatorFactory (line 11) | type OperatorFactory interface type OperatorBase (line 16) | type OperatorBase struct method SetA (line 21) | func (o *OperatorBase) SetA(a int) { method SetB (line 26) | func (o *OperatorBase) SetB(b int) { type PlusOperatorFactory (line 31) | type PlusOperatorFactory struct method Create (line 33) | func (PlusOperatorFactory) Create() Operator { type PlusOperator (line 40) | type PlusOperator struct method Result (line 45) | func (o PlusOperator) Result() int { type MinusOperatorFactory (line 50) | type MinusOperatorFactory struct method Create (line 52) | func (MinusOperatorFactory) Create() Operator { type MinusOperator (line 59) | type MinusOperator struct method Result (line 64) | func (o MinusOperator) Result() int { FILE: 04_factory_method/factorymethod_test.go function compute (line 5) | func compute(factory OperatorFactory, a, b int) int { function TestOperator (line 12) | func TestOperator(t *testing.T) { FILE: 05_abstract_factory/abstractfactory.go type OrderMainDAO (line 6) | type OrderMainDAO interface type OrderDetailDAO (line 11) | type OrderDetailDAO interface type DAOFactory (line 16) | type DAOFactory interface type RDBMainDAO (line 22) | type RDBMainDAO struct method SaveOrderMain (line 25) | func (*RDBMainDAO) SaveOrderMain() { type RDBDetailDAO (line 30) | type RDBDetailDAO struct method SaveOrderDetail (line 33) | func (*RDBDetailDAO) SaveOrderDetail() { type RDBDAOFactory (line 38) | type RDBDAOFactory struct method CreateOrderMainDAO (line 40) | func (*RDBDAOFactory) CreateOrderMainDAO() OrderMainDAO { method CreateOrderDetailDAO (line 44) | func (*RDBDAOFactory) CreateOrderDetailDAO() OrderDetailDAO { type XMLMainDAO (line 49) | type XMLMainDAO struct method SaveOrderMain (line 52) | func (*XMLMainDAO) SaveOrderMain() { type XMLDetailDAO (line 57) | type XMLDetailDAO struct method SaveOrderDetail (line 60) | func (*XMLDetailDAO) SaveOrderDetail() { type XMLDAOFactory (line 65) | type XMLDAOFactory struct method CreateOrderMainDAO (line 67) | func (*XMLDAOFactory) CreateOrderMainDAO() OrderMainDAO { method CreateOrderDetailDAO (line 71) | func (*XMLDAOFactory) CreateOrderDetailDAO() OrderDetailDAO { FILE: 05_abstract_factory/abstractfactory_test.go function getMainAndDetail (line 3) | func getMainAndDetail(factory DAOFactory) { function ExampleRdbFactory (line 8) | func ExampleRdbFactory() { function ExampleXmlFactory (line 17) | func ExampleXmlFactory() { FILE: 06_builder/builder.go type Builder (line 4) | type Builder interface type Director (line 10) | type Director struct method Construct (line 22) | func (d *Director) Construct() { function NewDirector (line 15) | func NewDirector(builder Builder) *Director { type Builder1 (line 28) | type Builder1 struct method Part1 (line 32) | func (b *Builder1) Part1() { method Part2 (line 36) | func (b *Builder1) Part2() { method Part3 (line 40) | func (b *Builder1) Part3() { method GetResult (line 44) | func (b *Builder1) GetResult() string { type Builder2 (line 48) | type Builder2 struct method Part1 (line 52) | func (b *Builder2) Part1() { method Part2 (line 56) | func (b *Builder2) Part2() { method Part3 (line 60) | func (b *Builder2) Part3() { method GetResult (line 64) | func (b *Builder2) GetResult() int { FILE: 06_builder/builder_test.go function TestBuilder1 (line 5) | func TestBuilder1(t *testing.T) { function TestBuilder2 (line 15) | func TestBuilder2(t *testing.T) { FILE: 07_prototype/prototype.go type Cloneable (line 4) | type Cloneable interface type PrototypeManager (line 8) | type PrototypeManager struct method Get (line 18) | func (p *PrototypeManager) Get(name string) Cloneable { method Set (line 22) | func (p *PrototypeManager) Set(name string, prototype Cloneable) { function NewPrototypeManager (line 12) | func NewPrototypeManager() *PrototypeManager { FILE: 07_prototype/prototype_test.go type Type1 (line 7) | type Type1 struct method Clone (line 11) | func (t *Type1) Clone() Cloneable { type Type2 (line 16) | type Type2 struct method Clone (line 20) | func (t *Type2) Clone() Cloneable { function TestClone (line 25) | func TestClone(t *testing.T) { function TestCloneFromManager (line 35) | func TestCloneFromManager(t *testing.T) { function init (line 45) | func init() { FILE: 08_mediator/mediator.go type CDDriver (line 8) | type CDDriver struct method ReadData (line 12) | func (c *CDDriver) ReadData() { type CPU (line 19) | type CPU struct method Process (line 24) | func (c *CPU) Process(data string) { type VideoCard (line 33) | type VideoCard struct method Display (line 37) | func (v *VideoCard) Display(data string) { type SoundCard (line 43) | type SoundCard struct method Play (line 47) | func (s *SoundCard) Play(data string) { type Mediator (line 53) | type Mediator struct method changed (line 69) | func (m *Mediator) changed(i interface{}) { function GetMediatorInstance (line 62) | func GetMediatorInstance() *Mediator { FILE: 08_mediator/mediator_test.go function TestMediator (line 5) | func TestMediator(t *testing.T) { FILE: 09_proxy/proxy.go type Subject (line 3) | type Subject interface type RealSubject (line 7) | type RealSubject struct method Do (line 9) | func (RealSubject) Do() string { type Proxy (line 13) | type Proxy struct method Do (line 17) | func (p Proxy) Do() string { FILE: 09_proxy/proxy_test.go function TestProxy (line 5) | func TestProxy(t *testing.T) { FILE: 10_observer/observer.go type Subject (line 5) | type Subject struct method Attach (line 16) | func (s *Subject) Attach(o Observer) { method notify (line 20) | func (s *Subject) notify() { method UpdateContext (line 26) | func (s *Subject) UpdateContext(context string) { function NewSubject (line 10) | func NewSubject() *Subject { type Observer (line 31) | type Observer interface type Reader (line 35) | type Reader struct method Update (line 45) | func (r *Reader) Update(s *Subject) { function NewReader (line 39) | func NewReader(name string) *Reader { FILE: 10_observer/observer_test.go function ExampleObserver (line 3) | func ExampleObserver() { FILE: 11_command/command.go type Command (line 5) | type Command interface type StartCommand (line 9) | type StartCommand struct method Execute (line 19) | func (c *StartCommand) Execute() { function NewStartCommand (line 13) | func NewStartCommand(mb *MotherBoard) *StartCommand { type RebootCommand (line 23) | type RebootCommand struct method Execute (line 33) | func (c *RebootCommand) Execute() { function NewRebootCommand (line 27) | func NewRebootCommand(mb *MotherBoard) *RebootCommand { type MotherBoard (line 37) | type MotherBoard struct method Start (line 39) | func (*MotherBoard) Start() { method Reboot (line 43) | func (*MotherBoard) Reboot() { type Box (line 47) | type Box struct method PressButton1 (line 59) | func (b *Box) PressButton1() { method PressButton2 (line 63) | func (b *Box) PressButton2() { function NewBox (line 52) | func NewBox(button1, button2 Command) *Box { FILE: 11_command/command_test.go function ExampleCommand (line 3) | func ExampleCommand() { FILE: 12_iterator/iterator.go type Aggregate (line 5) | type Aggregate interface type Iterator (line 9) | type Iterator interface type Numbers (line 15) | type Numbers struct method Iterator (line 26) | func (n *Numbers) Iterator() Iterator { function NewNumbers (line 19) | func NewNumbers(start, end int) *Numbers { type NumbersIterator (line 33) | type NumbersIterator struct method First (line 38) | func (i *NumbersIterator) First() { method IsDone (line 42) | func (i *NumbersIterator) IsDone() bool { method Next (line 46) | func (i *NumbersIterator) Next() interface{} { function IteratorPrint (line 55) | func IteratorPrint(i Iterator) { FILE: 12_iterator/iterator_test.go function ExampleIterator (line 3) | func ExampleIterator() { FILE: 13_composite/composite.go type Component (line 5) | type Component interface constant LeafNode (line 15) | LeafNode = iota constant CompositeNode (line 16) | CompositeNode function NewComponent (line 19) | func NewComponent(kind int, name string) Component { type component (line 32) | type component struct method Parent (line 37) | func (c *component) Parent() Component { method SetParent (line 41) | func (c *component) SetParent(parent Component) { method Name (line 45) | func (c *component) Name() string { method SetName (line 49) | func (c *component) SetName(name string) { method AddChild (line 53) | func (c *component) AddChild(Component) {} method Print (line 55) | func (c *component) Print(string) {} type Leaf (line 57) | type Leaf struct method Print (line 65) | func (c *Leaf) Print(pre string) { function NewLeaf (line 61) | func NewLeaf() *Leaf { type Composite (line 69) | type Composite struct method AddChild (line 80) | func (c *Composite) AddChild(child Component) { method Print (line 85) | func (c *Composite) Print(pre string) { function NewComposite (line 74) | func NewComposite() *Composite { FILE: 13_composite/composite_test.go function ExampleComposite (line 3) | func ExampleComposite() { FILE: 14_template_method/templatemethod.go type Downloader (line 5) | type Downloader interface type template (line 9) | type template struct method Download (line 25) | func (t *template) Download(uri string) { method save (line 33) | func (t *template) save() { type implement (line 14) | type implement interface function newTemplate (line 19) | func newTemplate(impl implement) *template { type HTTPDownloader (line 37) | type HTTPDownloader struct method download (line 48) | func (d *HTTPDownloader) download() { method save (line 52) | func (*HTTPDownloader) save() { function NewHTTPDownloader (line 41) | func NewHTTPDownloader() Downloader { type FTPDownloader (line 56) | type FTPDownloader struct method download (line 67) | func (d *FTPDownloader) download() { function NewFTPDownloader (line 60) | func NewFTPDownloader() Downloader { FILE: 14_template_method/templatemethod_test.go function ExampleHTTPDownloader (line 3) | func ExampleHTTPDownloader() { function ExampleFTPDownloader (line 14) | func ExampleFTPDownloader() { FILE: 15_strategy/strategy.go type Payment (line 5) | type Payment struct method Pay (line 26) | func (p *Payment) Pay() { type PaymentContext (line 10) | type PaymentContext struct function NewPayment (line 15) | func NewPayment(name, cardid string, money int, strategy PaymentStrategy... type PaymentStrategy (line 30) | type PaymentStrategy interface type Cash (line 34) | type Cash struct method Pay (line 36) | func (*Cash) Pay(ctx *PaymentContext) { type Bank (line 40) | type Bank struct method Pay (line 42) | func (*Bank) Pay(ctx *PaymentContext) { FILE: 15_strategy/strategy_test.go function ExamplePayByCash (line 3) | func ExamplePayByCash() { function ExamplePayByBank (line 10) | func ExamplePayByBank() { FILE: 16_state/state.go type Week (line 5) | type Week interface type DayContext (line 10) | type DayContext struct method Today (line 20) | func (d *DayContext) Today() { method Next (line 24) | func (d *DayContext) Next() { function NewDayContext (line 14) | func NewDayContext() *DayContext { type Sunday (line 28) | type Sunday struct method Today (line 30) | func (*Sunday) Today() { method Next (line 34) | func (*Sunday) Next(ctx *DayContext) { type Monday (line 38) | type Monday struct method Today (line 40) | func (*Monday) Today() { method Next (line 44) | func (*Monday) Next(ctx *DayContext) { type Tuesday (line 48) | type Tuesday struct method Today (line 50) | func (*Tuesday) Today() { method Next (line 54) | func (*Tuesday) Next(ctx *DayContext) { type Wednesday (line 58) | type Wednesday struct method Today (line 60) | func (*Wednesday) Today() { method Next (line 64) | func (*Wednesday) Next(ctx *DayContext) { type Thursday (line 68) | type Thursday struct method Today (line 70) | func (*Thursday) Today() { method Next (line 74) | func (*Thursday) Next(ctx *DayContext) { type Friday (line 78) | type Friday struct method Today (line 80) | func (*Friday) Today() { method Next (line 84) | func (*Friday) Next(ctx *DayContext) { type Saturday (line 88) | type Saturday struct method Today (line 90) | func (*Saturday) Today() { method Next (line 94) | func (*Saturday) Next(ctx *DayContext) { FILE: 16_state/state_test.go function ExampleWeek (line 3) | func ExampleWeek() { FILE: 17_memento/memento.go type Memento (line 5) | type Memento interface type Game (line 7) | type Game struct method Play (line 15) | func (g *Game) Play(mpDelta, hpDelta int) { method Save (line 20) | func (g *Game) Save() Memento { method Load (line 27) | func (g *Game) Load(m Memento) { method Status (line 33) | func (g *Game) Status() { type gameMemento (line 11) | type gameMemento struct FILE: 17_memento/memento_test.go function ExampleGame (line 3) | func ExampleGame() { FILE: 18_flyweight/flyweight.go type ImageFlyweightFactory (line 5) | type ImageFlyweightFactory struct method Get (line 20) | func (f *ImageFlyweightFactory) Get(filename string) *ImageFlyweight { function GetImageFlyweightFactory (line 11) | func GetImageFlyweightFactory() *ImageFlyweightFactory { type ImageFlyweight (line 30) | type ImageFlyweight struct method Data (line 42) | func (i *ImageFlyweight) Data() string { function NewImageFlyweight (line 34) | func NewImageFlyweight(filename string) *ImageFlyweight { type ImageViewer (line 46) | type ImageViewer struct method Display (line 57) | func (i *ImageViewer) Display() { function NewImageViewer (line 50) | func NewImageViewer(filename string) *ImageViewer { FILE: 18_flyweight/flyweight_test.go function ExampleFlyweight (line 5) | func ExampleFlyweight() { function TestFlyweight (line 12) | func TestFlyweight(t *testing.T) { FILE: 19_interpreter/interpreter.go type Node (line 8) | type Node interface type ValNode (line 12) | type ValNode struct method Interpret (line 16) | func (n *ValNode) Interpret() int { type AddNode (line 20) | type AddNode struct method Interpret (line 24) | func (n *AddNode) Interpret() int { type MinNode (line 28) | type MinNode struct method Interpret (line 32) | func (n *MinNode) Interpret() int { type Parser (line 36) | type Parser struct method Parse (line 42) | func (p *Parser) Parse(exp string) { method newAddNode (line 60) | func (p *Parser) newAddNode() Node { method newMinNode (line 68) | func (p *Parser) newMinNode() Node { method newValNode (line 76) | func (p *Parser) newValNode() Node { method Result (line 84) | func (p *Parser) Result() Node { FILE: 19_interpreter/interpreter_test.go function TestInterpreter (line 5) | func TestInterpreter(t *testing.T) { FILE: 20_decorator/decorator.go type Component (line 3) | type Component interface type ConcreteComponent (line 7) | type ConcreteComponent struct method Calc (line 9) | func (*ConcreteComponent) Calc() int { type MulDecorator (line 13) | type MulDecorator struct method Calc (line 25) | func (d *MulDecorator) Calc() int { function WrapMulDecorator (line 18) | func WrapMulDecorator(c Component, num int) Component { type AddDecorator (line 29) | type AddDecorator struct method Calc (line 41) | func (d *AddDecorator) Calc() int { function WrapAddDecorator (line 34) | func WrapAddDecorator(c Component, num int) Component { FILE: 20_decorator/decorator_test.go function ExampleDecorator (line 5) | func ExampleDecorator() { FILE: 21_chain_of_responsibility/chain.go type Manager (line 5) | type Manager interface type RequestChain (line 10) | type RequestChain struct method SetSuccessor (line 15) | func (r *RequestChain) SetSuccessor(m *RequestChain) { method HandleFeeRequest (line 19) | func (r *RequestChain) HandleFeeRequest(name string, money int) bool { method HaveRight (line 29) | func (r *RequestChain) HaveRight(money int) bool { type ProjectManager (line 33) | type ProjectManager struct method HaveRight (line 41) | func (*ProjectManager) HaveRight(money int) bool { method HandleFeeRequest (line 45) | func (*ProjectManager) HandleFeeRequest(name string, money int) bool { function NewProjectManagerChain (line 35) | func NewProjectManagerChain() *RequestChain { type DepManager (line 54) | type DepManager struct method HaveRight (line 62) | func (*DepManager) HaveRight(money int) bool { method HandleFeeRequest (line 66) | func (*DepManager) HandleFeeRequest(name string, money int) bool { function NewDepManagerChain (line 56) | func NewDepManagerChain() *RequestChain { type GeneralManager (line 75) | type GeneralManager struct method HaveRight (line 83) | func (*GeneralManager) HaveRight(money int) bool { method HandleFeeRequest (line 87) | func (*GeneralManager) HandleFeeRequest(name string, money int) bool { function NewGeneralManagerChain (line 77) | func NewGeneralManagerChain() *RequestChain { FILE: 21_chain_of_responsibility/chain_test.go function ExampleChain (line 3) | func ExampleChain() { FILE: 22_bridge/bridge.go type AbstractMessage (line 5) | type AbstractMessage interface type MessageImplementer (line 9) | type MessageImplementer interface type MessageSMS (line 13) | type MessageSMS struct method Send (line 19) | func (*MessageSMS) Send(text, to string) { function ViaSMS (line 15) | func ViaSMS() MessageImplementer { type MessageEmail (line 23) | type MessageEmail struct method Send (line 29) | func (*MessageEmail) Send(text, to string) { function ViaEmail (line 25) | func ViaEmail() MessageImplementer { type CommonMessage (line 33) | type CommonMessage struct method SendMessage (line 43) | func (m *CommonMessage) SendMessage(text, to string) { function NewCommonMessage (line 37) | func NewCommonMessage(method MessageImplementer) *CommonMessage { type UrgencyMessage (line 47) | type UrgencyMessage struct method SendMessage (line 57) | func (m *UrgencyMessage) SendMessage(text, to string) { function NewUrgencyMessage (line 51) | func NewUrgencyMessage(method MessageImplementer) *UrgencyMessage { FILE: 22_bridge/bridge_test.go function ExampleCommonSMS (line 3) | func ExampleCommonSMS() { function ExampleCommonEmail (line 10) | func ExampleCommonEmail() { function ExampleUrgencySMS (line 17) | func ExampleUrgencySMS() { function ExampleUrgencyEmail (line 24) | func ExampleUrgencyEmail() { FILE: 23_visitor/visitor.go type Customer (line 5) | type Customer interface type Visitor (line 9) | type Visitor interface type EnterpriseCustomer (line 13) | type EnterpriseCustomer struct method Accept (line 37) | func (c *EnterpriseCustomer) Accept(visitor Visitor) { type CustomerCol (line 17) | type CustomerCol struct method Add (line 21) | func (c *CustomerCol) Add(customer Customer) { method Accept (line 25) | func (c *CustomerCol) Accept(visitor Visitor) { function NewEnterpriseCustomer (line 31) | func NewEnterpriseCustomer(name string) *EnterpriseCustomer { type IndividualCustomer (line 41) | type IndividualCustomer struct method Accept (line 51) | func (c *IndividualCustomer) Accept(visitor Visitor) { function NewIndividualCustomer (line 45) | func NewIndividualCustomer(name string) *IndividualCustomer { type ServiceRequestVisitor (line 55) | type ServiceRequestVisitor struct method Visit (line 57) | func (*ServiceRequestVisitor) Visit(customer Customer) { type AnalysisVisitor (line 67) | type AnalysisVisitor struct method Visit (line 69) | func (*AnalysisVisitor) Visit(customer Customer) { FILE: 23_visitor/visitor_test.go function ExampleRequestVisitor (line 3) | func ExampleRequestVisitor() { function ExampleAnalysis (line 15) | func ExampleAnalysis() {