"HI" written in Go (Golang). If you need a socket server, you will love "HI".
$ git clone https://github.com/nightlegend/hi.git
Use a vendor tool like Govendor
go get
govendor
$ go get github.com/kardianos/govendor
- Create your project folder and
cd
inside
$ mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"
- Vendor init your project and add gin
$ govendor init
$ govendor add +external
$ govendor install +local
- Start redis server
- Configure your redis server connection.
func NewCli() (*redis.Client, error) {
client := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "", // no password set
DB: 0, // use default DB
})
err := client.Ping().Err()
return client, err
}
- Run your project
$ go run server.go