chore: initialize containerized Go learning workbook (2026 DevOps/SRE)
This commit is contained in:
commit
84be3e5d77
64 files changed
+1382
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package patterns
|
||||
|
||||
import "time"
|
||||
|
||||
type Client struct {
|
||||
Timeout time.Duration
|
||||
Retries int
|
||||
}
|
||||
|
||||
type Option func(*Client)
|
||||
|
||||
func WithTimeout(d time.Duration) Option {
|
||||
panic("TODO: zwróć Option ustawiającą c.Timeout = d")
|
||||
}
|
||||
|
||||
func WithRetries(n int) Option {
|
||||
panic("TODO: zwróć Option ustawiającą c.Retries = n")
|
||||
}
|
||||
|
||||
func NewClient(opts ...Option) Client {
|
||||
panic("TODO: utwórz Client{Timeout: 5 * time.Second, Retries: 3} i zastosuj opts")
|
||||
}
|
||||
|
||||
func RunWorkerPool(workers int, jobs []int, fn func(int) int) []int {
|
||||
panic("TODO: uruchom workers goroutines pobierających zadania z kanału")
|
||||
}
|
||||
Reference in new issue
Block a user