()
| 27 | } |
| 28 | |
| 29 | func ExampleGraphNew_pool() { |
| 30 | host := "localhost:6379" |
| 31 | pool := &redis.Pool{Dial: func() (redis.Conn, error) { |
| 32 | return redis.Dial("tcp", host) |
| 33 | }} |
| 34 | |
| 35 | graph := redisgraph.GraphNew("social", pool.Get()) |
| 36 | |
| 37 | q := "CREATE (w:WorkPlace {name:'RedisLabs'}) RETURN w" |
| 38 | res, _ := graph.Query(q) |
| 39 | |
| 40 | res.Next() |
| 41 | r := res.Record() |
| 42 | w := r.GetByIndex(0).(*redisgraph.Node) |
| 43 | fmt.Println(w.Label) |
| 44 | // Output: WorkPlace |
| 45 | |
| 46 | } |
| 47 | |
| 48 | func ExampleGraphNew_tls() { |
| 49 | // Consider the following helper methods that provide us with the connection details (host and password) |
nothing calls this directly
no test coverage detected