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
↓ 1 callers
Function
futureData
(url string)
messaging/future/futurev1/main.go:16
↓ 1 callers
Function
gen
The first stage, gen, is a function that converts a list of integers to a channel that emits the integers in the list. The gen function starts a gorou
messaging/fan_in_out/main.go:70
↓ 1 callers
Function
gen
(nums ...int)
concurrency/pipeline/pipeline/main.go:21
↓ 1 callers
Function
generateNumber
()
concurrency/iterator/iterator_sem/main.go:41
↓ 1 callers
Function
generatePipeline
(numbers []int)
messaging/fan/fan_in_out_test.go:29
↓ 1 callers
Method
getDataFromRegistry
(exploded []string, album Album)
behavioral/interpreter/Interpreter.go:41
↓ 1 callers
Function
getLetters
(gQ chan string)
concurrency/concurrency_in_go/ch1/letter_channel_example.go:15
↓ 1 callers
Function
getValue
()
playground/http/get_test.go:29
↓ 1 callers
Function
goSched
()
concurrency/concurrency_in_go/main.go:47
↓ 1 callers
Method
gotInterrupt
gotInterrupt verifies if the interrupt signal has been issued.
concurrency/runner/main.go:87
↓ 1 callers
Function
initializeRobots
initialize all robots
playground/mocklib/robot.go:32
↓ 1 callers
Method
isMaxPrice
(b Buyer ,price int)
behavioral/mediator/main.go:35
↓ 1 callers
Method
isNumeric
(s string)
behavioral/interpreter/Interpreter.go:59
↓ 1 callers
Function
listThreads
()
concurrency/concurrency_in_go/main.go:60
↓ 1 callers
Method
loop
loop periodically fecthes Items, sends them on s.updates, and exits when Close is called. It extends dedupeLoop with logic to run Fetch asynchronousl
concurrency/feedreader/main.go:245
↓ 1 callers
Method
loop
()
concurrency/feedreader/main.go:453
↓ 1 callers
Function
makeRequest
(out chan<- barrierResp, url string)
concurrency/barrier/main.go:47
↓ 1 callers
Function
merge
The merge function converts a list of channels to a single channel by starting a goroutine for each inbound channel that copies the values to the sole
messaging/fan_in_out/main.go:41
↓ 1 callers
Function
merge
(cs ...<-chan int)
concurrency/pipeline/pipeline/main.go:43
↓ 1 callers
Function
pass
(ps *string)
idiom/passbyvalue/main.go:27
↓ 1 callers
Function
passByPointer
(a *int)
playground/basic/address_test.go:19
↓ 1 callers
Function
passByVariable
(a int)
playground/basic/address_test.go:15
↓ 1 callers
Function
passStruct
(p *Person)
idiom/passbyvalue/main.go:34
↓ 1 callers
Function
passStructByPointer
(a *robot)
playground/basic/address_test.go:37
↓ 1 callers
Function
passStructByVariable
(a robot)
playground/basic/address_test.go:33
↓ 1 callers
Function
performQueries
performQueries tests the resource pool of connections.
workerpool/pool/main.go:185
↓ 1 callers
Function
print
(i int)
synchronization/waitgroup/main.go:25
↓ 1 callers
Function
printGopher
(upstream chan string)
playground/goroutine/pipeline_test.go:26
↓ 1 callers
Method
printName
()
concurrency/read_struct_props/main.go:28
↓ 1 callers
Function
produceErr
()
concurrency/subtasks/main.go:53
↓ 1 callers
Method
queueRoutine
queueRoutine captures and provides work.
workerpool/ardan_labs_worker_pool/worker_pool.go:263
↓ 1 callers
Function
read
()
concurrency/read_struct_props/main.go:63
↓ 1 callers
Function
readURLs
(statusChannel chan int, textChannel chan string)
concurrency/concurrency_in_go/ch1/spider.go:20
↓ 1 callers
Function
realFetch
realFetch returns a fetcher for the specified blogger domain.
concurrency/feedreader/main.go:531
↓ 1 callers
Function
resourceLeak
Here we see that the main goroutine passes a nil channel into doWork. Therefore, the strings channel will never actually gets any strings written onto
concurrency/goroutine_leak/main.go:35
↓ 1 callers
Method
run
run executes each registered task.
concurrency/runner/main.go:74
↓ 1 callers
Method
safelyDoWork
safelyDoWork executes the user DoWork method.
workerpool/ardan_labs_worker_pool/worker_pool.go:250
↓ 1 callers
Function
selectWithErrorDemo
()
concurrency/select_error_handling/main.go:17
↓ 1 callers
Method
sendTopic
发送主题,可以容忍一定的超时
messaging/pubsub/main.go:108
↓ 1 callers
Function
showNumber
(num int)
concurrency/concurrency_in_go/main.go:55
↓ 1 callers
Function
sleepyGopher
(id int)
playground/goroutine/basic_test.go:22
↓ 1 callers
Function
sleepyGopherSnore
(name string)
playground/goroutine/basic_waitgroup_test.go:28
↓ 1 callers
Function
sourceGopher
(downstream chan string)
playground/goroutine/pipeline_test.go:9
↓ 1 callers
Method
stream
(val interface{})
messaging/fanout.go:84
↓ 1 callers
Function
sumFiles
sumFiles starts goroutines to walk the directory tree at root and digest each regular file. These goroutines send the results of the digests on the r
concurrency/parallelism.go:25
↓ 1 callers
Function
syncWaitGroup
()
channel/basic/main.go:53
↓ 1 callers
Method
updateName1
simulate write operation for struct property which is name is this case
concurrency/read_struct_props/main.go:15
↓ 1 callers
Method
updateName2
simulate write operation for struct property which is name is this case
concurrency/read_struct_props/main.go:22
↓ 1 callers
Function
v2
()
concurrency/iterator/iterator_error_handling/main.go:77
↓ 1 callers
Function
walkFiles
walkFiles starts a goroutine to walk the directory tree at root and send the path of each regular file on the string channel. It sends the result of
concurrency/bounded/bounded_parallelism.go:17
↓ 1 callers
Function
withTimeOut
()
channel/behavior_of_channel/main.go:86
↓ 1 callers
Method
work
The work loop for any single goroutine.
workerpool/main.go:69
↓ 1 callers
Method
workRoutine
workRoutine performs the work required by the work pool
workerpool/ardan_labs_worker_pool/worker_pool.go:232
↓ 1 callers
Function
worker
(id int, lock chan bool)
concurrency/locker/main.go:28
↓ 1 callers
Function
write
()
concurrency/read_struct_props/main.go:67
↓ 1 callers
Function
writeStdoutf
writeStdoutf is used to write a formatted system message directly stdout.
workerpool/ardan_labs_worker_pool/worker_pool.go:227
Method
Accept
(v Visitor)
behavioral/visitor/main.go:19
Method
Accept
(v Visitor)
behavioral/visitor/main.go:28
Method
Accept
(v Visitor)
behavioral/visitor/main.go:37
Method
AddOne
()
creational/singleton/singleton.go:11
Method
Apply
(lval, rval int)
behavioral/strategy/main.go:18
Method
Apply
(lval, rval int)
behavioral/strategy/main.go:24
Method
Aquire
()
synchronization/semaphore2/main.go:39
Method
Attach
(abstractObserver AbstractObserver)
behavioral/observerpattern/main.go:14
Method
Attack
()
behavioral/command/main.go:33
Method
Await
()
concurrency/barrier/n_barrier/main.go:31
Function
BigIntFactorial
(x big.Int)
profiling/profile.go:15
Method
Close
STOPUPDATES OMIT STARTCLOSE OMIT STARTCLOSESIG OMIT
concurrency/feedreader/main.go:70
Method
Close
STOPNAIVEMERGE OMIT STARTNAIVEMERGECLOSE OMIT
concurrency/feedreader/main.go:339
Method
Close
STARTMERGECLOSE OMIT
concurrency/feedreader/main.go:402
Method
Close
()
concurrency/feedreader/main.go:479
Method
Close
Close will shutdown the pool and close all existing resources. Once the program is finished with the pool, it should call the Close method. The method
workerpool/pool/main.go:112
Method
Close
Close implements the io.Closer interface so dbConnection can be managed by the pool. Close performs any resource release management.
workerpool/pool/main.go:144
Method
Construct
()
creational/builder/builder.go:47
Function
Dedupe
Dedupe converts a Subscription that may send duplicate Items into one that doesn't.
concurrency/feedreader/main.go:443
Method
Deregister
Deregister removes an item identified by the passed id
behavioral/registry/registry.go:33
Method
Deregister
(id string)
behavioral/registry/registry.go:53
Method
Deregister
Deregister allows an instance to remove itself from the collection of observers/listeners.
behavioral/observer/main.go:34
Method
Deregister
(l Observer)
behavioral/observer/main.go:62
Method
Detach
(abstractObserver AbstractObserver)
behavioral/observerpattern/main.go:15
Method
Dispatch
(msg interface{})
messaging/fanout.go:46
Method
DoWork
(workRoutine int)
workerpool/ardan_labs_worker_pool/mian.go:19
Function
Double
(n int)
structural/decorator/decorate.go:19
Method
Draw
()
creational/factorymethod/shape/shape.go:10
Method
Draw
()
creational/factorymethod/shape/shape.go:16
Method
Draw
()
creational/factorymethod/shape/shape.go:23
Method
Draw
()
creational/factorymethod/shape/shape.go:30
Method
Drive
(vi VehicleAbstraction)
structural/bridge/main.go:51
Method
Drive
(vi VehicleAbstraction)
structural/bridge/main.go:58
Method
Error
()
behavioral/registry/registry.go:23
Method
Escape
()
behavioral/command/main.go:37
Method
Evaluate
(in interface{})
concurrency/subtasks/divide_and_conquer/divide_and_conquer.go:65
Method
Evict
退出订阅
messaging/pubsub/main.go:78
Function
ExampleDeadline
()
stability/deadline/deadline_test.go:56
Method
Execute
()
behavioral/command/main.go:14
Method
Execute
()
behavioral/command/main.go:21
Method
Execute
Execute just runs known commands for current authorized user
structural/proxy/main.go:48
Method
Fetch
(url string)
concurrency/subtasks/fetchers/fetchers.go:11
Method
Fetch
(url string)
concurrency/subtasks/fetchers/fetchers.go:19
Method
Fetch
(url string)
concurrency/subtasks/fetchers/fetchers.go:36
← previous
next →
201–300 of 583, ranked by callers