-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
94 lines (76 loc) · 3.5 KB
/
main.go
File metadata and controls
94 lines (76 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package main
import (
"fmt"
concurrency "github.com/mscode1729/coding-golang/concepts/01-goroutines-concurrency"
channels "github.com/mscode1729/coding-golang/concepts/02-channels"
synchronization "github.com/mscode1729/coding-golang/concepts/03-synchronization"
ctxpkg "github.com/mscode1729/coding-golang/concepts/04-context"
memory "github.com/mscode1729/coding-golang/concepts/05-memory-management"
interfaces "github.com/mscode1729/coding-golang/concepts/06-interfaces"
errorhandling "github.com/mscode1729/coding-golang/concepts/07-error-handling"
"strings"
highthroughput "github.com/mscode1729/coding-golang/designs/01-high-throughput-api"
workerpool "github.com/mscode1729/coding-golang/designs/02-worker-pool"
ratelimiter "github.com/mscode1729/coding-golang/designs/03-rate-limiter"
circuitbreaker "github.com/mscode1729/coding-golang/designs/04-circuit-breaker"
cache "github.com/mscode1729/coding-golang/designs/05-cache-with-ttl"
)
func main() {
fmt.Println("╔══════════════════════════════════════════════════════════╗")
fmt.Println("║ Go Concurrency & System Design Practice ║")
fmt.Println("╚══════════════════════════════════════════════════════════╝")
// Concepts Section
fmt.Println("\n" + strings.Repeat("=", 60))
fmt.Println("SECTION 1: CORE CONCEPTS")
fmt.Println(strings.Repeat("=", 60))
fmt.Println("\n[1] Goroutines & Concurrency")
fmt.Println(strings.Repeat("-", 60))
concurrency.TestGoroutines()
fmt.Println("\n[2] Channels (Advanced Usage)")
fmt.Println(strings.Repeat("-", 60))
channels.TestChannels()
fmt.Println("\n[3] Synchronization Primitives")
fmt.Println(strings.Repeat("-", 60))
synchronization.TestSynchronization()
fmt.Println("\n[4] Context Package")
fmt.Println(strings.Repeat("-", 60))
ctxpkg.TestContext()
fmt.Println("\n[5] Memory Management & GC")
fmt.Println(strings.Repeat("-", 60))
memory.TestMemory()
fmt.Println("\n[6] Interfaces (Design-Focused)")
fmt.Println(strings.Repeat("-", 60))
interfaces.TestInterfaces()
fmt.Println("\n[7] Error Handling Patterns")
fmt.Println(strings.Repeat("-", 60))
errorhandling.TestErrorHandling()
// Design Patterns Section
fmt.Println("\n" + strings.Repeat("=", 60))
fmt.Println("SECTION 2: SYSTEM DESIGN PATTERNS")
fmt.Println(strings.Repeat("=", 60))
fmt.Println("\n[1] High-Throughput API Service")
fmt.Println(strings.Repeat("-", 60))
highthroughput.RunExample()
fmt.Println("\n[2] Worker Pool Pattern")
fmt.Println(strings.Repeat("-", 60))
workerpool.RunExample()
fmt.Println("\n[3] Rate Limiter Patterns")
fmt.Println(strings.Repeat("-", 60))
ratelimiter.RunExample()
fmt.Println("\n[4] Circuit Breaker Pattern")
fmt.Println(strings.Repeat("-", 60))
circuitbreaker.RunExample()
fmt.Println("\n[5] Cache with TTL")
fmt.Println(strings.Repeat("-", 60))
cache.RunExample()
// Summary
fmt.Println("\n" + strings.Repeat("=", 60))
fmt.Println("✓ All examples completed successfully!")
fmt.Println(strings.Repeat("=", 60))
fmt.Println("\nNext Steps:")
fmt.Println("1. Review the README.md for detailed explanations")
fmt.Println("2. Explore each concept folder for in-depth material")
fmt.Println("3. Complete the exercises in each section")
fmt.Println("4. Build real-world applications using these patterns")
fmt.Println("\nHappy learning! 🚀")
}