Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/camilaleniss/design-patterns-go
/ functions
Functions
358 in github.com/camilaleniss/design-patterns-go
⨍
Functions
358
◇
Types & classes
174
↓ 1 callers
Method
Drive
()
3-structural/proxy/protection-proxy/main.go:7
↓ 1 callers
Method
Drive
also implements the interface
3-structural/proxy/protection-proxy/main.go:29
↓ 1 callers
Method
Earning
( annualIncome int)
2-creational/builder/advanced/main.go:48
↓ 1 callers
Method
End
(builder *strings.Builder)
4-behavioural/strategy/main.go:29
↓ 1 callers
Method
FindAllChildrenOf
(name string)
1-solid-principles/dependency-inversion/main.go:29
↓ 1 callers
Method
From
(from string)
2-creational/builder/parameter/main.go:13
↓ 1 callers
Method
GetCharacterAt
(index int)
3-structural/facade/main.go:51
↓ 1 callers
Method
GetHeight
()
1-solid-principles/liscov-substitution/main.go:8
↓ 1 callers
Method
GetPoints
()
3-structural/adapter/main.go:47
↓ 1 callers
Method
Handle
(*Query)
4-behavioural/chain-of-responsibility/broker-chain/main.go:28
↓ 1 callers
Method
Handle
calls the handle method of the modifier handles the end of the chain
4-behavioural/chain-of-responsibility/method-chain/main.go:42
↓ 1 callers
Method
HaveWinner
()
4-behavioural/template-method/main.go:18
↓ 1 callers
Method
In
( city string)
2-creational/builder/advanced/main.go:71
↓ 1 callers
Method
InOrder
implements the interface
4-behavioural/iterator/tree-transversal/main.go:83
↓ 1 callers
Method
Investigate
()
1-solid-principles/dependency-inversion/main.go:62
↓ 1 callers
Function
Lex
first part it's converting the string into tokens (lexing part)
4-behavioural/interpreter/main.go:77
↓ 1 callers
Method
Lives
method to set up the location
2-creational/builder/advanced/main.go:61
↓ 1 callers
Method
Message
(src, dst, msg string)
4-behavioural/mediator/main.go:54
↓ 1 callers
Method
Names
()
4-behavioural/iterator/main.go:20
↓ 1 callers
Function
NewAuxOfficeEmployee
( name string, suite int)
2-creational/prototype/factory/main.go:57
↓ 1 callers
Function
NewBankAccount
(balance int)
4-behavioural/memento/undo-redo/main.go:22
↓ 1 callers
Function
NewBetterFormattedText
the constructor
3-structural/flyweight/text-formatting-example/main.go:75
↓ 1 callers
Function
NewBinaryTree
(root *Node)
4-behavioural/iterator/tree-transversal/main.go:78
↓ 1 callers
Function
NewBitmap
when we initilize it, it it's loading the image. But we don't want to
3-structural/proxy/virtual-proxy/main.go:19
↓ 1 callers
Function
NewBuffer
(width, height int)
3-structural/facade/main.go:14
↓ 1 callers
Function
NewCarProxy
constructor
3-structural/proxy/protection-proxy/main.go:38
↓ 1 callers
Function
NewConsole
way to initialize in a default way
3-structural/facade/main.go:45
↓ 1 callers
Function
NewCreature
(game *Game, name string, attack int, defense int)
4-behavioural/chain-of-responsibility/broker-chain/main.go:68
↓ 1 callers
Function
NewCreature
(name string, attack int, defense int)
4-behavioural/chain-of-responsibility/method-chain/main.go:15
↓ 1 callers
Function
NewCreatureModifier
(creature *Creature)
4-behavioural/chain-of-responsibility/method-chain/main.go:48
↓ 1 callers
Function
NewDoubleAttackModifier
(g *Game, c *Creature)
4-behavioural/chain-of-responsibility/broker-chain/main.go:106
↓ 1 callers
Function
NewEmployee
functional
2-creational/factories/prototype/main.go:18
↓ 1 callers
Function
NewEmployeeFactory2
(position string, annualIncome int)
2-creational/factories/generator/main.go:26
↓ 1 callers
Function
NewExpressionPrinter
()
4-behavioural/visitor/classic/main.go:53
↓ 1 callers
Function
NewFormattedText
(plainText string)
3-structural/flyweight/text-formatting-example/main.go:31
↓ 1 callers
Function
NewGameOfChess
()
4-behavioural/template-method/main.go:36
↓ 1 callers
Function
NewHtmlBuilder
(rootName string)
2-creational/builder/basic/main.go:53
↓ 1 callers
Function
NewIncreasedDefenseModifier
( c *Creature)
4-behavioural/chain-of-responsibility/method-chain/main.go:67
↓ 1 callers
Function
NewLazyBitmap
(filename string)
3-structural/proxy/virtual-proxy/main.go:44
↓ 1 callers
Function
NewMainOfficeEmployee
there you jjust change the office basic object
2-creational/prototype/factory/main.go:52
↓ 1 callers
Function
NewMoneyTransferCommand
(from *BankAccount, to *BankAccount, amount int)
4-behavioural/command/composite-command/main.go:123
↓ 1 callers
Function
NewNode
(value int, left *Node, right *Node)
4-behavioural/iterator/tree-transversal/main.go:10
↓ 1 callers
Function
NewOnState
()
4-behavioural/state/main.go:48
↓ 1 callers
Function
NewPerson
(name string)
4-behavioural/observer/main.go:52
↓ 1 callers
Function
NewPerson
(age int)
4-behavioural/observer/property-dependencies/main.go:39
↓ 1 callers
Function
NewPerson
(age int)
4-behavioural/observer/property-changes/main.go:39
↓ 1 callers
Function
NewPerson
factory function: just a single function handles all the creation
2-creational/factories/function/main.go:17
↓ 1 callers
Function
NewPersonBuilder
()
2-creational/builder/advanced/main.go:15
↓ 1 callers
Function
NewRectangle
the "interface" you are given
3-structural/adapter/main.go:31
↓ 1 callers
Function
NewSquare
(size int)
1-solid-principles/liscov-substitution/main.go:42
↓ 1 callers
Function
NewSwitch
()
4-behavioural/state/main.go:15
↓ 1 callers
Function
NewTextProcessor
pass the strategy
4-behavioural/strategy/main.go:70
↓ 1 callers
Function
NewViewport
(buffer *Buffer)
3-structural/facade/main.go:29
↓ 1 callers
Method
Off
(sw *Switch)
4-behavioural/state/main.go:30
↓ 1 callers
Method
On
()
4-behavioural/state/main.go:19
↓ 1 callers
Method
On
(sw *Switch)
4-behavioural/state/main.go:29
↓ 1 callers
Function
Parse
final part is parse those tokens
4-behavioural/interpreter/main.go:110
↓ 1 callers
Function
PlayGame
the high-level algorithm
4-behavioural/template-method/main.go:24
↓ 1 callers
Function
PlayGame
notice that here we don't have interfaces or structs just funcs
4-behavioural/template-method/functional-approach/main.go:7
↓ 1 callers
Function
Print
have to cast the type
4-behavioural/visitor/reflective/main.go:21
↓ 1 callers
Method
Print
it's intrusive cause you pass the sb over the hierarchy violating the open-closed principle
4-behavioural/visitor/intrusive/main.go:28
↓ 1 callers
Method
PrivateMessage
(who, message string)
4-behavioural/mediator/main.go:28
↓ 1 callers
Method
Redo
()
4-behavioural/memento/undo-redo/main.go:65
↓ 1 callers
Method
Render
()
3-structural/decorator/main.go:20
↓ 1 callers
Method
Render
()
3-structural/decorator/main.go:49
↓ 1 callers
Method
Render
()
3-structural/decorator/main.go:59
↓ 1 callers
Method
RenderCircle
(radius float32)
3-structural/bridge/main.go:15
↓ 1 callers
Function
SaveToFile
can work... but let's make this better
1-solid-principles/single-responsibility/main.go:53
↓ 1 callers
Method
Scan
(d Document)
1-solid-principles/interface-segregation/main.go:10
↓ 1 callers
Function
SendEmail
this actually have access to the email
2-creational/builder/parameter/main.go:47
↓ 1 callers
Method
SetAge
(age int)
4-behavioural/observer/property-dependencies/main.go:55
↓ 1 callers
Method
SetAge
(age int)
4-behavioural/observer/property-changes/main.go:52
↓ 1 callers
Method
SetHeight
(height int)
1-solid-principles/liscov-substitution/main.go:9
↓ 1 callers
Method
SetOutputFormat
redefine strategy
4-behavioural/strategy/main.go:75
↓ 1 callers
Method
Start
(builder *strings.Builder)
4-behavioural/strategy/main.go:28
↓ 1 callers
Method
Start
()
4-behavioural/template-method/main.go:17
↓ 1 callers
Method
String
string method to be able to print this entity well :)
1-solid-principles/single-responsibility/main.go:17
↓ 1 callers
Method
String
()
4-behavioural/interpreter/main.go:72
↓ 1 callers
Method
String
()
3-structural/flyweight/text-formatting-example/main.go:58
↓ 1 callers
Method
String
()
2-creational/builder/basic/main.go:59
↓ 1 callers
Method
Subject
(subject string)
2-creational/builder/parameter/main.go:28
↓ 1 callers
Method
TakeTurn
()
4-behavioural/template-method/main.go:19
↓ 1 callers
Method
To
(to string)
2-creational/builder/parameter/main.go:23
↓ 1 callers
Method
VisitAdditionExpression
(ae *AdditionExpression)
4-behavioural/visitor/classic/main.go:10
↓ 1 callers
Method
VisitAdditionExpression
(ae *AdditionExpression)
4-behavioural/visitor/classic/main.go:45
↓ 1 callers
Method
VisitDoubleExpression
(de *DoubleExpression)
4-behavioural/visitor/classic/main.go:9
↓ 1 callers
Method
WinningPlayer
()
4-behavioural/template-method/main.go:20
↓ 1 callers
Method
WithPostcode
( postcode string)
2-creational/builder/advanced/main.go:77
↓ 1 callers
Function
Withdraw
(ba *BankAccount, amount int)
4-behavioural/command/functional/main.go:14
↓ 1 callers
Method
Works
returns the job builder
2-creational/builder/advanced/main.go:31
↓ 1 callers
Method
WorksAsA
extend PersonBuilder
2-creational/builder/functional/main.go:30
↓ 1 callers
Method
addLineCached
(line Line)
3-structural/adapter/main.go:114
↓ 1 callers
Method
filterByColor
now we can filter by color
1-solid-principles/open-closed/main.go:32
↓ 1 callers
Method
print
(sb *strings.Builder, depth int)
3-structural/composite/drawing-example/main.go:21
↓ 1 callers
Function
readData
init() — we could, but it's not lazy
2-creational/singleton/main.go:49
↓ 1 callers
Method
saveToFile
(j *Journal, filename string)
1-solid-principles/single-responsibility/main.go:63
↓ 1 callers
Function
sendMailImpl
(email *email)
2-creational/builder/parameter/main.go:40
↓ 1 callers
Method
string
string method to print this as HTML
2-creational/builder/basic/main.go:27
Method
Accept
if double expresion
4-behavioural/visitor/classic/main.go:23
Method
Accept
if addition expression
4-behavioural/visitor/classic/main.go:32
← previous
next →
101–200 of 358, ranked by callers