Zenler Player
Your course is loading. Hang tight.
Working with Design Patterns in Go (Golang)
Back to curriculum
0% Complete
0% Complete
Introduction
Installing Go
Installing an Integrated Development Environment
Installing Docker
Asking for Help
Mistakes. We all make them.
What we'll build in this section
How web applications work
Setting up our main application
Installing a routing package
Setting up routes
Setting up a simple HTML template
Creating a render function
Rendering our first page
Adding navigation
Creating templates for all site pages
Setting up a route & handler for site pages
Trying out our template cache
Adding WebP and jpeg images to the home page
What we'll build in this section
The Factory Pattern
Setting up some types
Creating a simple Factory
Creating handlers for the simple Factory
Setting up the front end
Adding routes for our Factory handlers
Trying our Factory pattern out
The Abstract Factory pattern
Creating an Abstract Factory
Creating a route and handler for the Abstract Factory
Updating the front end
Trying out our Abstract Factory
What we'll build in this section
Adding a module to support MySQL/MariaDB
Setting up a local MariaDB instance with Docker
Connecting our application to MariaDB
What we will build in this section
Writing our first database function
Creating a handler to list dog breeds
Updating the front end to fetch the list of dog breeds
Updating the front end to display the list of dog breeds
Writing a test for our handlers
Implementing the Repository pattern I
Implementing the Repository pattern II
Implementing the Repository pattern III
Trying things out
Implementing a test database repository
Updating our handler test
What we'll build in this section
Creating a simple Singleton
Updating our project to use our configuration package (singleton)
What we'll build in this section
The Builder Pattern (& Fluent Interface)
Getting started with the Builder pattern in our project
Setting up our Builder code
Fixing three problems with our Builder code
Setting up a handler to use our Builder pattern
Setting up a route to our handler
Modifying the front end to call our Builder route
Challenge
Solution to challenge
What we'll cover in this section
The Adapter Pattern - Overview
Installing an application to serve JSON and XML
Setting up the Adapter type & the Adaptee
Adding the Adapter to our application config
Setting up a handler
Adding a route
Updating the Cat Breeds template
Switching adapters from JSON to XML
Adding a test for the Cat Breeds handler, using our adapter pattern
What we'll cover in this section
Creating a stub AnimalFromAbstractFactory handler
Creating a New factory function for pet with embedded breed
Creating stub newPetWithBreed method for Cats and Dogs
Adding a GetDogBreedByName method in the database Repository
Refactoring adapters.go to new package
Adding a GetCatBreedByName method on our JSON adapter
Adding a GetCatBreedByName method on our XML adapter
Finishing up the new Adapter and Abstract Factory code
Finishing up the changes in our Abstract Factory to use the new adapters
Setting up a route to our stub handler
Finishing off the handler code
Updating the front end to try things out
Writing the necessary javascript to call our back end
What we'll cover in this section
Setting up a route and a stub handler
Setting up the database table
Adding database methods for Dog of Month
Completing our DogOfMonth handler
Creating the Dog of Month template and trying things out
What we'll cover in this section
Worker Pool Overview
Setting up a Go Workspace to develop our new module
Getting started with the App and Streamer projects
Creating a Factory function for our Worker Pool
Getting started on the worker pool functionality
Setting up the Processor type
Setting up the Pool functionality
Creating Videos to send to the worker pool
Sending videos to the worker pool
Filling in the encode() function's logic
Trying things out and tracing through program execution
Installing ffmpeg
Adding logic to encode to MP4
Trying out the EncodeToMP4 method
Adding logic to encode to HLS: Part One
Adding logic to encode to HLS: Part Two
Trying out our HLS encoder
Adding random filename generation to our videos
Trying out our worker pool with four videos
Adding streamer to our Breeders project
Introoduction
Introduction
Preview
Installing Go
Installing an Integrated Development Environment
Installing Docker
Asking for Help
Mistakes. We all make them.
Setting up a Simple Web Application
What we'll build in this section
Preview
How web applications work
Preview
Setting up our main application
Installing a routing package
Setting up routes
Setting up a simple HTML template
Creating a render function
Rendering our first page
Adding navigation
Creating templates for all site pages
Setting up a route & handler for site pages
Trying out our template cache
Adding WebP and jpeg images to the home page
Factory Patterns
What we'll build in this section
Preview
The Factory Pattern
Setting up some types
Creating a simple Factory
Creating handlers for the simple Factory
Setting up the front end
Adding routes for our Factory handlers
Trying our Factory pattern out
The Abstract Factory pattern
Creating an Abstract Factory
Creating a route and handler for the Abstract Factory
Updating the front end
Trying out our Abstract Factory
Connecting to a Database
What we'll build in this section
Adding a module to support MySQL/MariaDB
Setting up a local MariaDB instance with Docker
Connecting our application to MariaDB
The Repository Pattern
What we will build in this section
Preview
Writing our first database function
Preview
Creating a handler to list dog breeds
Updating the front end to fetch the list of dog breeds
Updating the front end to display the list of dog breeds
Writing a test for our handlers
Preview
Implementing the Repository pattern I
Implementing the Repository pattern II
Implementing the Repository pattern III
Trying things out
Implementing a test database repository
Updating our handler test
The Singleton Pattern
What we'll build in this section
Creating a simple Singleton
Updating our project to use our configuration package (singleton)
Builder Pattern & Fluent Interface
What we'll build in this section
The Builder Pattern (& Fluent Interface)
Getting started with the Builder pattern in our project
Preview
Setting up our Builder code
Fixing three problems with our Builder code
Setting up a handler to use our Builder pattern
Setting up a route to our handler
Modifying the front end to call our Builder route
Challenge
Solution to challenge
Adapter Pattern
What we'll cover in this section
The Adapter Pattern - Overview
Installing an application to serve JSON and XML
Preview
Setting up the Adapter type & the Adaptee
Adding the Adapter to our application config
Setting up a handler
Adding a route
Updating the Cat Breeds template
Switching adapters from JSON to XML
Adding a test for the Cat Breeds handler, using our adapter pattern
Bringing it all together
What we'll cover in this section
Creating a stub AnimalFromAbstractFactory handler
Creating a New factory function for pet with embedded breed
Creating stub newPetWithBreed method for Cats and Dogs
Adding a GetDogBreedByName method in the database Repository
Refactoring adapters.go to new package
Adding a GetCatBreedByName method on our JSON adapter
Adding a GetCatBreedByName method on our XML adapter
Finishing up the new Adapter and Abstract Factory code
Finishing up the changes in our Abstract Factory to use the new adapters
Setting up a route to our stub handler
Finishing off the handler code
Updating the front end to try things out
Writing the necessary javascript to call our back end
The Decorator Pattern
What we'll cover in this section
Preview
Setting up a route and a stub handler
Preview
Setting up the database table
Adding database methods for Dog of Month
Completing our DogOfMonth handler
Creating the Dog of Month template and trying things out
The Worker Pool Pattern
What we'll cover in this section
Worker Pool Overview
Setting up a Go Workspace to develop our new module
Getting started with the App and Streamer projects
Creating a Factory function for our Worker Pool
Getting started on the worker pool functionality
Setting up the Processor type
Setting up the Pool functionality
Creating Videos to send to the worker pool
Sending videos to the worker pool
Filling in the encode() function's logic
Trying things out and tracing through program execution
Installing ffmpeg
Adding logic to encode to MP4
Trying out the EncodeToMP4 method
Adding logic to encode to HLS: Part One
Adding logic to encode to HLS: Part Two
Trying out our HLS encoder
Adding random filename generation to our videos
Trying out our worker pool with four videos
Adding streamer to our Breeders project
×
This is an unpublished lesson. This lesson will not be shown for students unless you set it as Public.
Back to Dashboard
No contents are available in this lesson!
No lessons available !
Back to Dashboard
Lesson contents locked
Enroll to unlock this lesson.
Enroll to unlock
Next Lesson