In episode 9, Miki discussed how a command flag can be decoded into a user defined type with the Value interface. As a recap, the Value interface consists of two methods: one for serializing the underlying concrete type and one for deserializing a string into an object. To put this interface to the test, Miki wrote a command that had a flag to specify a network address. While implementing the Set method of the Value interface, Miki demonstrated how to add validation for your program’s flags.
In this video, Miki will build an HTTP server with one endpoint to display the health of his server. The first step he took was to define a HTTP handler to illustrate how a Go handler becomes a HandlerFunc. Next, Miki will design a function signature for middleware with the goal of abstracting input and output as much as possible. Miki will then define a logging middleware that measures the time of a request. Watch and learn how you can write a HTTP handler that is extendable with middleware.
Things you will learn in this video
From the Ardan Community
Get your team up to date with best practices & customized curriculum.
We help you evaluate your architecture, design, structure, tech-debt and human capital.
Learn at your own pace!
Special offers on upcoming training events & our latest blog posts.
Valid email required.
Submit failed. Try again or message us directly at email@example.com.
Check your email for confirmation.
We've built our reputation as educators and bring that mentality to every project. When you partner with us, your team will learn best practices and grow along the way.
Years in Business
Please fill out the form below, and we'll get back to you soon.
Check your email for confirmation of your sent message. We'll get back to you shortly.
Ardan Labs Copyrights © 2024