Serving static files with golang or gorilla mux
Today, we are going to demonstrate how one could serve static site/ content using golang’s net/http
or using gorilla/mux
. Let us create base for this. First we would create a directory
Interfaces in Golang
Golang implements interfaces as types and as collection of methods(specs for what should be considered of that type). Let’s first talk about collection of methods (specs that other types could implement)
Go waitgroup with goroutines
Previously in Golang Concurrency we talked about how goroutines in Go language works. Today we will focus on providing robustness to our previous talk by using semaphores from Golang sync package.
Go lang and MVC
Its been long since working with go language, been awesome experience so far. This post is regarding how one can structure go application in MVC structure like Rails. This example would be using Martini - A Golang MVC and Gorm - A Golang MVC, for demonstration purpose only.
Go to Go - Struct and Methods
Go has a speciel type struct
to define custome type with named fields. Struct act like collection of attributes/properties similar to classes in OOPS languages out there, but not exactly.
Go to Go - Packages
Go is modern language, so it has to take care of current software development practices; code reuse or DRY (Don’t Repeat Yourself) being one of them. In go code can be packed into modules and shipped. Lets look into how go uses packages.
Go to Go - Concurrency Part#2
In last part, where we discussed Golang Concurrency, we talked about goroutines
and channels. As discussed there is much more to channels, liked channel direction, by default a channel is bi-directional, but it can be restricted to sending or receiving.
Go to Go - Concurrency Part#1
Go came to existance to solve problems being faced by today’s software, one of them is concurrency (ability to execute stuff in parallel while providing control and communication among them). To solve this go has provided goroutines to execute stuff in parallel.
Introduction to Maps in Elixir
Elixir v0.13 has introduced Maps
, a key value store. Quoting elixir 0.13 docs
Indexes do not scale, choose them wisely
Indexes are most commonly related to improving database speed, query efficiency and lowering latency. As in wikipedia