- 29
- 218 230
david hwang
United States
Приєднався 24 січ 2021
Go & Kubernetes!
Ep9 Send Email Notifications in Goroutines (WaitGroup and Semaphores in Golang)
Now that we have the gRPC implemementations to list and update notification events, let's create an ecomm-notification microservice to send email notification for each of the events.
github.com/dhij/ecomm
blog post on keeping reference to the variable in a loop fixed in Go 1.22: go.dev/blog/loopvar-preview
0:00 intro and recap
1:56 loop every 30 seconds with a ticker
3:23 goroutines and a common mistake
4:33 add waitGroup and semaphores
6:45 add methods to send email and update db accordingly
11:53 add the ecomm-notification main file and run the server
14:13 add a quick fix for the demo
15:21 bring up services and test endpoints
github.com/dhij/ecomm
blog post on keeping reference to the variable in a loop fixed in Go 1.22: go.dev/blog/loopvar-preview
0:00 intro and recap
1:56 loop every 30 seconds with a ticker
3:23 goroutines and a common mistake
4:33 add waitGroup and semaphores
6:45 add methods to send email and update db accordingly
11:53 add the ecomm-notification main file and run the server
14:13 add a quick fix for the demo
15:21 bring up services and test endpoints
Переглядів: 471
Відео
Ep8 Golang Enqueue Notifications into a Stateful Database Queue
Переглядів 4092 місяці тому
Let's see how we can use a database as a queue and enqueue notification events. These notification events will later be consumed by our notification microservice to send email notifications to the customers. github.com/dhij/ecomm 0:00 intro 3:58 add migration files to update order status 4:46 add storer to update order status 6:01 add RPC to update order status 10:58 add handler and route to up...
Ep7 Protobuf, gRPC Client & Server Setup in Golang
Переглядів 1 тис.2 місяці тому
gRPC setup is an essential step to allow performant communication between microservices and before moving onto the next part where we will be adding the notification microservice. github.com/dhij/ecomm 0:00 intro 5:28 add the protobuf and RPC definitions 8:00 compile protobufs and RPCs 10:09 set up and register our server with the gRPC server 14:58 set up gRPC client on ecomm-api microservice 1...
Ep6 Golang Microservice Admin & Authorization Middlewares
Переглядів 6672 місяці тому
Now that we have our JWT, we can add admin and authorization middlewares to apply authorization rules to our endpoints. github.com/dhij/ecomm 0:00 intro 1:33 add user id foreign key to an order 3:31 middleware example 4:28 implement the middlewares 8:30 why we use an empty struct for the context key 9:41 add middlewares to routes 13:04 read user claims/information from our handlers 16:05 test t...
Ep5 Golang Microservice JWT Authentication and Refresh Token
Переглядів 1,9 тис.3 місяці тому
We will look at JWT authentication and session management with refresh tokens. We will create endpoints to login/logout/renew/revoke the tokens. github.com/dhij/ecomm 0:00 intro 0:25 what is JWT 2:13 how authentication works & why we need refresh token 3:18 access vs refresh token 4:17 add the users table and storer/server/handler methods to create/list/update/delete user 13:00 add the login en...
Ep4 Golang Microservice HTTP RESTful API Routing with go-chi
Переглядів 6773 місяці тому
Now that we have the storer methods to interact with the database, we can get started with routing at the http layer. github.com/dhij/ecomm 0:00 intro 1:20 create the server and methods 2:49 add the createProduct, getProduct, listProducts, updateProduct, and deleteProduct handler methods 13:38 add routes to the products endpoints 15:34 import the missing mysql driver package in db 15:56 run mys...
Ep3 Golang Microservice Query Multiple Tables with One-To-Many in a Database Transaction with sqlx
Переглядів 7143 місяці тому
To query multiple tables with one-to-many relationships, we have to ensure that the queries are either committed on success or rolled back on failure altogether. That is where the database transaction comes into place to make our operations atomic. github.com/dhij/ecomm 0:00 intro 1:08 intro to database transaction 1:44 define the structs 2:21 add the CreateOrder storer method 3:07 add the data...
Ep2 Golang Microservice Query MySQL & sqlmock to Write Unit Tests for an E-commerce Backend
Переглядів 1,1 тис.4 місяці тому
Now that we have set up our database in our last episode, we can now start querying the MySQL database from our Go app. github.com/dhij/ecomm 0:00 intro 0:24 sql vs. sqlx comparison 1:52 go mod init & connect to DB 4:03 create our main.go file 5:28 create our MySQL storer file 6:11 add the Create/Get/List/Update/DeleteProduct storer methods 10:38 write unit tests with sqlmock for TestCreateProd...
Ep1 Golang Microservice Database Setup for E-commerce Backend (Docker & golang-migrate)
Переглядів 1,6 тис.4 місяці тому
Before we start with anything, we need to set up our database. In this episode, we design our database schema, bring up MySQL on a docker container, and create & apply database migration files to automate the database setup. github.com/dhij/ecomm 0:00 intro and database schema design 1:51 dbdiagram.io to generate the SQL file 3:16 intro to docker concepts & commands 6:25 connect to the MySQL co...
Ep0 Golang Microservice Course Overview - Build an E-commerce Backend
Переглядів 2,1 тис.4 місяці тому
This is a practical and beginner-friendly course to build an e-commerce backend in Go. Stay tuned for the upcoming videos! github.com/dhij/ecomm
Nginx Ingress Controller & Cert Manager Setup in 2024
Переглядів 5 тис.6 місяців тому
set up nginx ingress controller and cert manager. you don't have to watch the older video to follow along but it might help: ua-cam.com/video/bkCNX8HF9mc/v-deo.htmlsi=QvNJGUmLZCp-T4LC github: github.com/dhij/cluster-demo ingress-nginx: github.com/kubernetes/ingress-nginx ingress doc: kubernetes.io/docs/concepts/services-networking/ingress/ ingress rewrite-target annotation doc: kubernetes.githu...
Deploy Go App to Production Kubernetes & Database
Переглядів 8817 місяців тому
feel free to watch the last two videos to continue following along: ua-cam.com/video/2QMoLyfIJx8/v-deo.htmlsi=qyWe-7eiGGmlTRtm ua-cam.com/video/p0n90IUfjp4/v-deo.htmlsi=s8RYFTGrQMPdQfQ5 learn how to migrate your database tables to a production database and kubernetes basics to deploy your app on a cluster. github: github.com/dhij/cluster-demo How to Connect to MySQL Database Clusters: docs.digi...
Install Older Version of Docker Desktop on MacOS (brew install, SHA256 mismatch)
Переглядів 3,9 тис.9 місяців тому
docker desktop: docs.docker.com/desktop/release-notes/ homebrew: formulae.brew.sh/cask/docker
Connect to MySQL on Golang and Create Docker-Compose file
Переглядів 1,6 тис.9 місяців тому
Now that we have a Dockerfile for our Go app from our last video, we want to run the Go app along with a MySQL container. In this video, we will extend our Go app to insert & get users into/from the database before writing our docker-compose yaml. We will validate everything works at the end of the video. github: github.com/dhij/cluster-demo
Dockerfile for Golang Step by Step 2024 (multi-stage build with distroless/scratch)
Переглядів 4,5 тис.9 місяців тому
This video covers how to build your Dockerfile and run the container by mapping the port. The Dockerfile uses multi-stage builds which allows us to build a small-sized minimal image. Here is the docker docs covering multi-stage builds: docs.docker.com/build/building/multi-stage/ If you are ever interested in what the difference between using the distroless vs. scratch as the base image is, have...
Goroutines Explained - channels, waitGroup, cancellation, & running loop in parallel
Переглядів 719Рік тому
Goroutines Explained - channels, waitGroup, cancellation, & running loop in parallel
Deploy Hugo Blog to Github Pages via Github Actions w/ a Custom Domain
Переглядів 15 тис.Рік тому
Deploy Hugo Blog to Github Pages via Github Actions w/ a Custom Domain
Realtime Chat Part 3: Frontend UI with NextJS, Typescript, & TailwindCSS
Переглядів 6 тис.Рік тому
Realtime Chat Part 3: Frontend UI with NextJS, Typescript, & TailwindCSS
Go Realtime Chat Part 2: websocket connection + chat rooms management
Переглядів 19 тис.Рік тому
Go Realtime Chat Part 2: websocket connection chat rooms management
Go Realtime Chat Part 1: authentication + db connection setup (clean architecture, cookie-based JWT)
Переглядів 40 тис.Рік тому
Go Realtime Chat Part 1: authentication db connection setup (clean architecture, cookie-based JWT)
Unsupervised Clustering with Siamese Neural Network and DBSCAN (Keras, Triplet Loss, VGG16)
Переглядів 4,7 тис.Рік тому
Unsupervised Clustering with Siamese Neural Network and DBSCAN (Keras, Triplet Loss, VGG16)
Deploy Serverless Function on k3s/Kubernetes with OpenFaaS (x86/Arm, Linux VM, Go)
Переглядів 1 тис.Рік тому
Deploy Serverless Function on k3s/Kubernetes with OpenFaaS (x86/Arm, Linux VM, Go)
Install Kubernetes Cluster with kubeadm (Linux VM/Mac/Windows, x86/Arm)
Переглядів 56 тис.2 роки тому
Install Kubernetes Cluster with kubeadm (Linux VM/Mac/Windows, x86/Arm)
When to use Pointers in Go w/ Practical Example - Heap/Stack, Pointer Receiver
Переглядів 3 тис.2 роки тому
When to use Pointers in Go w/ Practical Example - Heap/Stack, Pointer Receiver
Thymeleaf Setup 2022 - CSS/Bootstrap, Page Layout, Fragments, Live Reload
Переглядів 7 тис.3 роки тому
Thymeleaf Setup 2022 - CSS/Bootstrap, Page Layout, Fragments, Live Reload
JWT Authentication - Part 3: Redux Typescript for Login
Переглядів 9 тис.3 роки тому
JWT Authentication - Part 3: Redux Typescript for Login
JWT Authentication - Part 2: React Typescript Authentication Page
Переглядів 11 тис.3 роки тому
JWT Authentication - Part 2: React Typescript Authentication Page
JWT Authentication - Part 1: Golang w/ Gin Backend Setup
Переглядів 12 тис.3 роки тому
JWT Authentication - Part 1: Golang w/ Gin Backend Setup
Awesome Tutorial Thanks
Mr David please give us some updates.
great course with great teacher
Hey currently your gohugo version doesn't work with the theme papermod
we are in oct buddy!!!! still waiting for this awesome course
Here is the cli he ran to create the migration docker run -it --rm --network host --volume "$(pwd)/db:/db" migrate/migrate:v4.17.0 create -ext sql -dir /db/migrations init_schema
niceee vid man , but next time include my right ear too
may i ask, why you use panic in deleteOrder func.
good content and explaination
Great instructions helped my undderstand the concepts.
i love this video
I like how he explains Docker stuff. Well done.
still waiting until you come Back Broooo hehheheheh
i am sorry for the delay bro, i have a big event coming this weekend and i am traveling the following week so I will probably work on the videos the second week of October 😓
@@dhij yoshaaa still wait your best content learn for SWE ComeBack Again :) hehehehe
@@dhij second week in october .. ready for ComeBack My Boyyy hehehehhehe :)
hands down one of the best golang series out there!
Thank you.
your channel is a gold mine, thank you for making these videos!
Glad to hear you liked the videos!
Yoshaaa please continue your best journey 😊😊
sorry for the delay, the uploads are going to be slower till October unfortunately because i am preparing for an event in October 😓
@@dhij thanks for your work
@@dhij yoshaa stilll waiting and keep Smile bro:)
Why is it everyone doing tutorials so eager to press enter after the autocompleting the command, why cant you wait half a second after autocompleting it so it is visible, like as if this is some eastern egg in the video that I need to pause to catch.
Thnk for videos. Please give some advice for my project. I am trying to combine python grpc server to combine with above golang project.
Your voice audio only plays in my left ear
my apology, thats my bad 😓
This is so amazing. Thank you David!
My pleasure!
This is just the bestttt
Glad to hear you found it helpful!
Can you also create a video on cert-manager for wildcard ? or do you have any tutorial about wildcard certificate.
thank you
Good to see you back!
🥳🥳🥳
Helpful video
awesome!
Nice, Any specific reasons to choose Go for backend?
nope, this is a Go tutorial so things are built with Go 🙂
Hey are going to add docker-compose in your project in future? Actually I'm trying on my own but since I'm new to Docker i find it little difficult
hello, yup i will work on that on the next episode. my old videos ua-cam.com/video/2QMoLyfIJx8/v-deo.html and ua-cam.com/video/p0n90IUfjp4/v-deo.html might help, did you get a chance to have a look?
@@dhij thank you 🤝, I will look into it
This is nice david. Also, You missed returning the error from context.Err() when waiting for context.Done()
hello there, thank you! do you mean the part where we have a case for `<-ctx.Done()` in the select statement? we wouldn't need to return the error there since our `Run()` method doesn't return any error 🙂 but of course it will be up to you to decide how you want that to be structured.
@@dhij yeah that part, gotcha!
Thanks I was waiting for it.
cool, thank you for waiting!
How many videos are left to complete this series? Great series 👍
Thank you! I would say at least 5-6 more 🙂
Don't worry, take your time@@dhij
Well done.
thank you!
this series is streets ahead
@dhij I got error as 'error' is of type 'unknown'.ts(18046) (local var) error: unknown at error.response && error.response.data.message ? error.response.data.message : error.message. How to resolve this?
hello the error seems to suggest the type for the error is not defined :)
please upload next part
thank you for your patience, i should have it some time next week 🙂
Very cool, the explanation is easy to understand. hope you are always healthy
very cool, but missing server validation I guess, because if I send an empty json file { } the service will still process it
yup the project is oriented towards learning and is nowhere perfect/production-ready 🙂
Very helpful especially for beginners like me. the concept used is very good.
Glad to hear you found it helpful!
So happy that u dropped another video will be it later today.
Glad to hear you like the series!
David can you please share these diagrams in the repo too.
Thank you for the reminder, i will update the repo and the README
Great 👍 Lovin this series so much for my brain.
Thats awesome!
great thank. please share ur experience to do debug and logger
appreciate the feedback 👍 i will take note of that
Yoshaaaaaaaa First one Human on Earth 😂😂😂😂 Watch your best learn journey
you are too fast 😂
@@dhij letsssgooo continue your content amazing Brow :)hheheheh
Couldn't do it, it sucks how confusing git and github is. actions and all.
oh no, do take your time to learn one thing at a time! let me know if you have any specific question 👍
You're the best man! I couldn't get this working at all, your explanation was clear and concise.
Thats awesome, thank you!
done watching and absorbing all the info thanks for the videos so far.
Thats awesome!! Hope you found it useful 👍
I followed all the steps (I had to change some commandes becouse I don"t have touch and vim ) but it give a blank page. also my project folder didn't upload
i could take a look if you have a public github repo 👍
There is a correction at 16:20, i think u have mistakenly included a test for CreateOrder into the test suites of GetOrders.
great content
does anyone really understand all of this