Let’s Go! Learn to build professional web applications with Go / Поехали! Научитесь создавать профессиональные веб-приложения с помощью Go, 2-е издание
Год издания: 2025
Автор: Edwards Alex / Эдвардс Алекс
Издательство: Self-published
ISBN: Нет
Язык: Английский
Формат: PDF
Качество: Издательский макет или текст (eBook)
Интерактивное оглавление: Да
Количество страниц: 441
Описание: Let’s Go teaches you step-by-step how to create fast, secure and maintainable web applications using the fantastic programming language Go.
The idea behind this book is to help you learn by doing. Together we’ll walk through the start-to- finish build of a web application — from structuring your workspace, through to session management, authenticating users, securing your server and testing your application.
Building a complete web application in this way has several benefits. It helps put the things you’re learning into context, it demonstrates how different parts of your codebase link together, and it forces us to work through the edge-cases and difficulties that come up when writing software in real-life. In essence, you’ll learn more than you would by just reading Go’s (great) documentation or standalone blog posts.
By the end of the book you’ll have the understanding — and confidence — to build your own production-ready web applications with Go.
Although you can read this book cover-to-cover, it’s designed specifically so you can follow along with the project build yourself.
Break out your text editor, and happy coding!
— Alex
Let's Go пошагово научит вас создавать быстрые, безопасные и обслуживаемые веб-приложения с использованием фантастического языка программирования Go.
Идея, лежащая в основе этой книги, состоит в том, чтобы помочь вам учиться на практике. Вместе мы пройдем от начала до конца сборки веб-приложения - от структурирования вашего рабочего пространства до управления сеансами, аутентификации пользователей, обеспечения безопасности вашего сервера и тестирования вашего приложения.
Создание полноценного веб-приложения таким способом имеет несколько преимуществ. Это помогает поместить то, что вы изучаете, в контекст, демонстрирует, как различные части вашей кодовой базы связаны друг с другом, и заставляет нас работать над крайними случаями и трудностями, которые возникают при написании программного обеспечения в реальной жизни. По сути, вы узнаете больше, чем если бы просто прочитали (отличную) документацию по Go или отдельные записи в блоге.
К концу книги у вас появится понимание — и уверенность — для создания собственных готовых к работе веб-приложений с помощью Go.
Хотя вы можете прочитать эту книгу от корки до корки, она разработана специально для того, чтобы вы могли следить за процессом создания проекта самостоятельно.
Открывайте свой текстовый редактор и счастливого кодирования!
— Алекс
Внимание торрент обновлен. Просьба перекачать файл.
Причина: Обновление до версии 2.24.0.
Оглавление
1. Introduction
1.1. Prerequisites
2. Foundations
2.1. Project setup and creating a module
2.2. Web application basics
2.3. Routing requests
2.4. Wildcard route patterns
2.5. Method-based routing
2.6. Customizing responses
2.7. Project structure and organization
2.8. HTML templating and inheritance
2.9. Serving static files
2.10. The http.Handler interface
3. Configuration and error handling
3.1. Managing configuration settings
3.2. Structured logging
3.3. Dependency injection
3.4. Centralized error handling
3.5. Isolating the application routes
4. Database-driven responses
4.1. Setting up MySQL
4.2. Installing a database driver
4.3. Modules and reproducible builds
4.4. Creating a database connection pool
4.5. Designing a database model
4.6. Executing SQL statements
4.7. Single-record SQL queries
4.8. Multiple-record SQL queries
4.9. Transactions and other details
5. Dynamic HTML templates
5.1. Displaying dynamic data
5.2. Template actions and functions
5.3. Caching templates
5.4. Catching runtime errors
5.5. Common dynamic data
5.6. Custom template functions
6. Middleware
6.1. How middleware works
6.2. Setting common headers
6.3. Request logging
6.4. Panic recovery
6.5. Composable middleware chains
7. Processing forms
7.1. Setting up an HTML form
7.2. Parsing form data
7.3. Validating form data
7.4. Displaying errors and repopulating fields
7.5. Creating validation helpers
7.6. Automatic form parsing
8. Stateful HTTP
8.1. Choosing a session manager
8.2. Setting up the session manager
8.3. Working with session data
9. Server and security improvements
9.1. The http.Server struct
9.2. The server error log
9.3. Generating a self-signed TLS certificate
9.4. Running a HTTPS server
9.5. Configuring HTTPS settings
9.6. Connection timeouts
10. User authentication
10.1. Routes setup
10.2. Creating a users model
10.3. User signup and password encryption
10.4. User login
10.5. User logout
10.6. User authorization
10.7. CSRF protection
11. Using request context
11.1. How request context works
11.2. Request context for authentication/authorization
12. File embedding
12.1. Embedding static files
12.2. Embedding HTML templates
13. Testing
13.1. Unit testing and sub-tests
13.2. Testing HTTP handlers and middleware
13.3. End-to-end testing
13.4. Customizing how tests run
13.5. Mocking dependencies
13.6. Testing HTML forms
13.7. Integration testing
13.8. Profiling test coverage
14. Conclusion
15. Further reading and useful links
16. Guided exercises
16.1. Add an 'About' page to the application
16.2. Add a debug mode
16.3. Test the snippetCreate handler
16.4. Add an 'Account' page to the application
16.5. Redirect user appropriately after login
16.6. Implement a 'Change Password' feature