A comprehensive collection of Go (Golang) development examples, patterns, and best practices. This repository serves as a learning resource and reference implementation for various Go development scenarios.
This repository contains practical examples and implementations of various Go development concepts, from basic web applications to advanced distributed systems patterns. It's designed to help developers learn and implement Go best practices in real-world scenarios.
- Clone the repository:
git clone https://github.com/ducnpdev/open-dev.git
cd open-dev
- Install dependencies:
go mod download
- Explore the examples in each directory based on your interests.
- Let's Go: Build web applications in Go
- Gin Web Framework:
- Kafka:
- Advanced Consumer Patterns
- Consumer group management
- Offset handling
- Error recovery
- Advanced Producer Patterns
- Topic management
- Partition strategies
- Message delivery guarantees
- Basic Examples
- Installation guide
- Simple producer/consumer setup
- Configuration examples
- Advanced Consumer Patterns
- RabbitMQ:
- Code examples and patterns
- Message routing
- Queue management
- Exchange types
- Redis:
- Rate Limiting Implementation
- Token bucket algorithm
- Sliding window implementation
- Rate limit article
- Pub/Sub Patterns
- Publisher implementation
- Subscriber patterns
- Message handling
- Installation Guide
- Setup instructions
- Configuration examples
- Connection management
- Rate Limiting Implementation
- Database Connection Management:
- Strategy patterns for database connections
- Connection pooling
- Retry mechanisms
- Error handling
- AWS:
- Lambda Functions:
- S3 Operations:
- File upload/download
- Bucket management
- Access control
- Textract Integration:
- Terraform:
- SQS Setup:
- Queue creation
- Access policies
- Monitoring setup
- API Gateway Configuration:
- Endpoint setup
- Integration patterns
- Security configurations
- SQS Setup:
- Serverless Framework:
- Implementation guide
- Function deployment
- Environment management
- RSA:
- Encryption/Decryption examples
- Key generation
- Message signing
- ECDSA:
- Digital signature implementation
- Key pair management
- Signature verification
- TLS:
- Certificate handling
- Base64 conversion
- Key management
- Password Security:
- Hashing algorithms
- Salt implementation
- Secure storage practices
- HTTP Optimization:
// Example of HTTP connection reuse func Reuse() { clientTrace := &httptrace.ClientTrace{ GotConn: func(info httptrace.GotConnInfo) { log.Printf("conn was reused: %t", info.Reused) }, } // ... implementation details in http/reuse-http/ }
- Performance Testing:
- Concurrency Patterns:
- Essential Go concurrency patterns
- Channel management
- Goroutine best practices
- UUID Usage:
- Benefits:
- Distributed system compatibility
- Unpredictability for security
- Drawbacks:
- Storage overhead
- Non-sequential nature
- Benefits:
- HTTPS Implementation:
- TLS handshake process
- Certificate management
- Security best practices
- SSO (Single Sign-On):
- Authentication flow
- Token management
- Session handling
- Database Design:
- Password storage best practices
- Salt implementation
- Hash algorithms
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Author: Đức Nguyễn Phúc
- Email: [email protected] or [email protected]
- Social Media:
This project is licensed under the terms of the license included in the repository. See the LICENSE file for details.
⭐ If you find this repository helpful, please give it a star! Your support helps maintain and improve this resource for the Go community.