- 29
- 231 441
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
มุมมอง: 599
วีดีโอ
Ep8 Golang Enqueue Notifications into a Stateful Database Queue
มุมมอง 5074 หลายเดือนก่อน
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.2K4 หลายเดือนก่อน
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
มุมมอง 8624 หลายเดือนก่อน
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
มุมมอง 3.1K5 หลายเดือนก่อน
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
มุมมอง 8895 หลายเดือนก่อน
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
มุมมอง 9145 หลายเดือนก่อน
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.4K5 หลายเดือนก่อน
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)
มุมมอง 2K6 หลายเดือนก่อน
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.6K6 หลายเดือนก่อน
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
มุมมอง 7K8 หลายเดือนก่อน
set up nginx ingress controller and cert manager. you don't have to watch the older video to follow along but it might help: th-cam.com/video/bkCNX8HF9mc/w-d-xo.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.gith...
Deploy Go App to Production Kubernetes & Database
มุมมอง 9929 หลายเดือนก่อน
feel free to watch the last two videos to continue following along: th-cam.com/video/2QMoLyfIJx8/w-d-xo.htmlsi=qyWe-7eiGGmlTRtm th-cam.com/video/p0n90IUfjp4/w-d-xo.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.di...
Install Older Version of Docker Desktop on MacOS (brew install, SHA256 mismatch)
มุมมอง 4.7K10 หลายเดือนก่อน
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.8K11 หลายเดือนก่อน
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)
มุมมอง 5K11 หลายเดือนก่อน
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
มุมมอง 743ปีที่แล้ว
Goroutines Explained - channels, waitGroup, cancellation, & running loop in parallel
Deploy Hugo Blog to Github Pages via Github Actions w/ a Custom Domain
มุมมอง 16Kปีที่แล้ว
Deploy Hugo Blog to Github Pages via Github Actions w/ a Custom Domain
Realtime Chat Part 3: Frontend UI with NextJS, Typescript, & TailwindCSS
มุมมอง 6Kปีที่แล้ว
Realtime Chat Part 3: Frontend UI with NextJS, Typescript, & TailwindCSS
Go Realtime Chat Part 2: websocket connection + chat rooms management
มุมมอง 20K2 ปีที่แล้ว
Go Realtime Chat Part 2: websocket connection chat rooms management
Go Realtime Chat Part 1: authentication + db connection setup (clean architecture, cookie-based JWT)
มุมมอง 41K2 ปีที่แล้ว
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.8K2 ปีที่แล้ว
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.1K2 ปีที่แล้ว
Deploy Serverless Function on k3s/Kubernetes with OpenFaaS (x86/Arm, Linux VM, Go)
Install Kubernetes Cluster with kubeadm (Linux VM/Mac/Windows, x86/Arm)
มุมมอง 58K2 ปีที่แล้ว
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.1K2 ปีที่แล้ว
When to use Pointers in Go w/ Practical Example - Heap/Stack, Pointer Receiver
Thymeleaf Setup 2022 - CSS/Bootstrap, Page Layout, Fragments, Live Reload
มุมมอง 7K3 ปีที่แล้ว
Thymeleaf Setup 2022 - CSS/Bootstrap, Page Layout, Fragments, Live Reload
JWT Authentication - Part 3: Redux Typescript for Login
มุมมอง 9K3 ปีที่แล้ว
JWT Authentication - Part 3: Redux Typescript for Login
JWT Authentication - Part 2: React Typescript Authentication Page
มุมมอง 11K3 ปีที่แล้ว
JWT Authentication - Part 2: React Typescript Authentication Page
JWT Authentication - Part 1: Golang w/ Gin Backend Setup
มุมมอง 12K3 ปีที่แล้ว
JWT Authentication - Part 1: Golang w/ Gin Backend Setup
I have an issue with my application running in a Kubernetes cluster and exposed via Ingress. The application displays correctly when I access the public IP or domain name, but I encounter 404 errors for routes such as `/Api/admin/category` and `/Api/admin/courses`. All my backend routes start with `/Api`. In my Ingress configuration, I mapped `/` to the frontend and `/Api` to the backend.
I would love if there was a way to do all of this but with a private GitHub repo, please let us know if that's possible. Thanks!
Hello can I hav ur contact, I want 1 to 1 sessions. Is it possible
What to do if my load balancer is private in this case? Since, the DNS resolution applies to public IP of the load balancer, how can I do the TLS validation in ingress resource?
Very helpful, thanks a lot !!
W video. Thank you very much for making these tutorials.
How do you handle when the you get an error that migration down fails and you have dirty set to true?
if you are not busy i hope this will be continued. thank you for teaching me ♥️
Is is true that the mock exams of KodeKloud are harder than the real exam?
come back broo please :) hehheheh
Thanks David, well explained installation process.
Lovely video, thank you! I do have one small nitpick of a feedback. You don't need to generate a JWT for refresh tokens. They can be opaque strings and you can persist their expiration in the storage, as you will need to make a trip there anyway to fetch it and revoke it.
How could I change permissions on migration files. Cannot edit up/down files. It says read only. Im using wsl2 ubuntu
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 th-cam.com/video/2QMoLyfIJx8/w-d-xo.html and th-cam.com/video/p0n90IUfjp4/w-d-xo.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 🙂