Skip to content

nightlegend/hi

Repository files navigation

"HI" socket server

Build Status codecov

"HI" written in Go (Golang). If you need a socket server, you will love "HI".

socket process

SOCKET

Start using it

$ git clone https://github.com/nightlegend/hi.git

Use a vendor tool like Govendor

  1. go get govendor
$ go get github.com/kardianos/govendor
  1. Create your project folder and cd inside
$ mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"
  1. Vendor init your project and add gin
$ govendor init
$ govendor add +external
$ govendor install +local
  1. Start redis server

redis

  1. 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
}
  1. Run your project
$ go run server.go