From e1bf322337411221086117f2bb5add7a7220d939 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Mon, 21 Nov 2016 11:15:09 -0700 Subject: [PATCH] Update README.md --- client/README.md | 70 +++++------------------------------------------- 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/client/README.md b/client/README.md index be9e861b..fdf55772 100644 --- a/client/README.md +++ b/client/README.md @@ -6,69 +6,11 @@ Tile38 Client Tile38 Client is a [Go](http://golang.org/) client for [Tile38](http://tile38.com/). -## Examples - -#### Connection -```go -package main - -import "github.com/tidwall/tile38/client" - -func main(){ - conn, err := client.Dial("localhost:9851") - if err != nil { - log.Fatal(err) - } - defer conn.Close() - resp, err := conn.Do("set fleet truck1 point 33.5123 -112.2693") - if err != nil { - log.Fatal(err) - } - fmt.Println(string(resp)) -} +THIS LIBRARY IS DEPRECATED +========================== +Please use the [redigo](https://github.com/garyburd/redigo) client library instead. +If you need JSON output with Redigo then call: +``` +conn.Do("OUTPUT", "JSON") ``` - -#### Pool -```go -package main - -import "github.com/tidwall/tile38/client" - -func main(){ - pool, err := client.DialPool("localhost:9851") - if err != nil { - log.Fatal(err) - } - defer pool.Close() - - // We'll set a point in a background routine - go func() { - conn, err := pool.Get() // get a conn from the pool - if err != nil { - log.Fatal(err) - } - defer conn.Close() // return the conn to the pool - _, err = conn.Do("set fleet truck1 point 33.5123 -112.2693") - if err != nil { - log.Fatal(err) - } - }() - time.Sleep(time.Second / 2) // wait a moment - - // Retrieve the point we just set. - go func() { - conn, err := pool.Get() // get a conn from the pool - if err != nil { - log.Fatal(err) - } - defer conn.Close() // return the conn to the pool - resp, err := conn.Do("get fleet truck1 point") - if err != nil { - log.Fatal(err) - } - fmt.Println(string(resp)) - }() - time.Sleep(time.Second / 2) // wait a moment -} -```:q \ No newline at end of file