Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/crazybber/awesome-patterns
/ functions
Functions
583 in github.com/crazybber/awesome-patterns
⨍
Functions
583
◇
Types & classes
195
Method
Speak
()
playground/benchmark/main.go:15
Method
Start
(player string)
behavioral/chain_of_responsibility/main.go:37
Method
Start
(player string)
behavioral/chain_of_responsibility/main.go:49
Method
Start
(ctx context.Context)
messaging/fanout.go:26
Method
Start
Start runs all tasks and monitors channel events.
concurrency/runner/main.go:56
Method
Subscribe
添加一个新的订阅者,订阅全部主题
messaging/pubsub/main.go:64
Method
Task
Task implements the Worker interface.
concurrency/worker_unbuffed/main.go:103
Function
TestBarrier
(t *testing.T)
concurrency/barrier/main_test.go:5
Function
TestBuilderPatter
(t *testing.T)
creational/builder/builder/main_test.go:7
Function
TestCarFactory
(t *testing.T)
creational/abstract_factory/main_test.go:7
Function
TestCborEncode
(t *testing.T)
playground/cbor/cbor_test.go:17
Function
TestCborEncode2
(t *testing.T)
playground/cbor/cbor2_test.go:16
Function
TestCborEncode3
(t *testing.T)
playground/cbor/cbor3_test.go:11
Function
TestCronWithAddFunc
(t *testing.T)
playground/cron/cron_test.go:57
Function
TestCronWithAddJob
(t *testing.T)
playground/cron/cron_test.go:21
Function
TestDeadline
(t *testing.T)
stability/deadline/deadline_test.go:29
Function
TestDeadlock
A deadlock happens when a group of goroutines are waiting for each other and none of them is able to proceed. The program will get stuck on the channe
playground/goroutine/deadlock_test.go:8
Function
TestFiveGopher
(t *testing.T)
playground/goroutine/basic_test.go:14
Function
TestFiveGopherWithChan
(t *testing.T)
playground/goroutine/basic_chan_test.go:9
Function
TestGet
(t *testing.T)
playground/http/get_test.go:14
Function
TestGo
想弄清楚slice遍历时被修改到底会发生什么. 结果是安全失败. 并不意味着是线程安全的.
behavioral/chain_of_responsibility/go_test.go:13
Function
TestMakeRobotsSayHi
(t *testing.T)
playground/mocklib/robot_test.go:13
Function
TestMergeNumbersSeq
(T *testing.T)
messaging/fan/fan_in_out_test.go:9
Function
TestOneGopher
(t *testing.T)
playground/goroutine/basic_test.go:9
Function
TestParse
(t *testing.T)
data/xml/xml_test.go:15
Function
TestParseISO8601
(t *testing.T)
playground/cron/cron_test.go:77
Function
TestParseInt
(t *testing.T)
playground/parse/parseInt_test.go:9
Function
TestPipeline
Pipeline source->filter->print
playground/goroutine/pipeline_test.go:33
Function
TestPostYamlString
(t *testing.T)
playground/http/postyamlstring_test.go:11
Function
TestPrintAddress
(t *testing.T)
playground/basic/address_test.go:8
Function
TestSay
(t *testing.T)
playground/factory/robot_test.go:5
Function
TestSize
(t *testing.T)
playground/codecoverage/size_test.go:19
Function
TestStartRobots
(t *testing.T)
playground/mocklib/robot_test.go:9
Function
TestStringorError_Execute
(t *testing.T)
messaging/future/future/main_test.go:6
Function
TestStructAddress
(t *testing.T)
playground/basic/address_test.go:26
Function
TestSync
(t *testing.T)
playground/syncmap/syncmap_test.go:13
Function
TestSync2
(t *testing.T)
playground/syncmap/syncmap_test.go:30
Function
TestSync3
(t *testing.T)
playground/syncmap/syncmap_test.go:42
Function
TestUploadFormFile
(t *testing.T)
playground/http/upload_test.go:14
Function
TestWaitGophers
(t *testing.T)
playground/goroutine/basic_waitgroup_test.go:10
Function
Try
()
playground/panic/trypanic.go:7
Method
Type
()
behavioral/chain_of_responsibility/main.go:41
Method
Type
()
behavioral/chain_of_responsibility/main.go:53
Method
Update
(s AbstractSubject)
behavioral/observerpattern/main.go:23
Method
Updates
STARTUPDATES OMIT
concurrency/feedreader/main.go:62
Method
Updates
STOPNAIVEMERGECLOSE OMIT
concurrency/feedreader/main.go:351
Method
Updates
()
concurrency/feedreader/main.go:397
Method
Updates
()
concurrency/feedreader/main.go:485
Method
VisitNPC
(n NPCHost)
behavioral/visitor/main.go:55
Method
VisitNPC
(n NPCHost)
behavioral/visitor/main.go:70
Method
VisitObject
(o ObjectHost)
behavioral/visitor/main.go:59
Method
VisitObject
(o ObjectHost)
behavioral/visitor/main.go:74
Method
VisitPlayer
(p PlayerHost)
behavioral/visitor/main.go:51
Method
VisitPlayer
(p PlayerHost)
behavioral/visitor/main.go:66
Function
add
(n int)
functions/main.go:11
Function
appendInt
(x []int, y int)
playground/slice/slice.go:16
Function
arrayEach
(value []byte, dataType jsonparser.ValueType, offset int, err error)
data/xml/xml_test.go:61
Function
block
The deferred func above will only run when the func ends not when the deferred func’s surrounding block ends (the area inside curly braces containing
playground/defer/main.go:28
Function
blockOnAttemptingToWriteToChannel
()
concurrency/confinement/lexical/main.go:77
Function
buf
()
channel/basic/main.go:29
Function
caller
()
concurrency/subtasks/main.go:47
Function
createConnection
createConnection is a factory method that will be called by the pool when a new connection is needed.
workerpool/pool/main.go:154
Method
dedupeLoop
dedupeLoop extends mergedLoop with deduping of fetched items.
concurrency/feedreader/main.go:191
Function
deferInsideLoop
Do not use defer inside a loop unless you are sure about what you are doing. It may not work as expected. However, in some situations it will be handy
playground/defer/main.go:17
Function
deferStruct
So, when a method with a value-receiver is used with defer, the receiver will be copied (in this case Car) at the time of registering and the changes
playground/defer/main.go:56
Function
fanout
()
channel/behavior_of_channel/main.go:29
Function
init
()
shadow/main.go:9
Function
init
()
playground/factory/robotfuncs.go:13
Function
init
TODO: in a longer talk: move the Subscribe function onto a Reader type, to support dynamically adding and removing Subscriptions. Reader should dedup
concurrency/feedreader/main.go:577
Function
init
init is called when the system is inited.
workerpool/ardan_labs_worker_pool/worker_pool.go:125
Function
lexicalDemo
()
concurrency/confinement/lexical/main.go:26
Function
lexicalNotConcurrentSafe
()
concurrency/confinement/lexical/main.go:58
Method
loopCloseOnly
STOPCLOSE OMIT loopCloseOnly is a version of loop that includes only the logic that handles Close.
concurrency/feedreader/main.go:81
Method
loopFetchOnly
loopFetchOnly is a version of loop that includes only the logic that calls Fetch.
concurrency/feedreader/main.go:97
Method
loopSendOnly
loopSendOnly is a version of loop that includes only the logic for sending items to s.updates.
concurrency/feedreader/main.go:125
Function
looprint
(count int)
synchronization/waitgroup/main.go:19
Function
main
()
behavioral/strategy/main.go:28
Function
main
()
behavioral/memento/main.go:62
Function
main
()
behavioral/interpreter/main.go:8
Function
main
()
behavioral/command/main.go:63
Function
main
()
behavioral/chain_of_responsibility/main.go:57
Function
main
()
behavioral/state/main.go:54
Function
main
()
behavioral/mediator/main.go:52
Function
main
()
behavioral/observerpattern/main.go:62
Function
main
()
behavioral/visitor/main.go:78
Function
main
()
behavioral/template/main.go:40
Function
main
()
behavioral/observer/main.go:72
Function
main
()
messaging/future/main.go:32
Function
main
()
messaging/future/future/main.go:3
Function
main
()
messaging/future/futurev1/main.go:30
Function
main
* There's no formal definition of a pipeline in Go; it's just one of many kinds of concurrent programs. Informally, a pipeline is a series of stages c
messaging/fan_in_out/main.go:22
Function
main
**在发布订阅模型中,每条消息都会传送给多个订阅者。发布者通常不会知道、也不关心哪一 个订阅者正在接收主题消息。订阅者和发布者可以在运行时动态添加是一种松散的耦合关 心,这使得系统的复杂性可以随时间的推移而增长。在现实生活中,不同城市的象天气预报 之类的应用就可以应用这个并发模式。 */
messaging/pubsub/main.go:15
Function
main
()
shadow/main.go:15
Function
main
()
data/graphql/main.go:11
Function
main
()
structural/decorator/decorate.go:23
Function
main
()
structural/bridge/main.go:62
Function
main
()
structural/composite/main.go:26
Function
main
()
structural/facade/main.go:58
Function
main
For example: we must a execute some command so before that we must to create new terminal session and provide our user name and command
structural/proxy/main.go:11
Function
main
()
structural/flyweight/main.go:26
← previous
next →
401–500 of 583, ranked by callers