{"repo":"xyproto/simpleredis","free":true,"listed":false,"github":"https://github.com/xyproto/simpleredis","clone":"git clone https://github.com/xyproto/simpleredis.git","description":":radio: Simple way to use Redis from Go","language":"Go","stars":25,"topics":["redis","strings","go"],"license":"BSD-3-Clause","category":"databases-storage","readme_excerpt":"Simple Redis ============ Easy way to use Redis from Go. Dependencies ------------ Requires Go 1.17 or later. Online API Documentation ------------------------ godoc.org Features and limitations ------------------------ Supports simple use of lists, hashmaps, sets and key/values Deals mainly with strings Uses the redigo package Example usage ------------- go package main import ( \"log\" \"github.com/xyproto/simpleredis/v2\" ) func main() { // Check if the redis service is up if err := simpleredis.TestConnection(); err != nil { log.Fatalln(\"Could not connect to Redis. Is the service up and running?\") } // For checking if a Redis server on a specific host:port is up. // simpleredis.TestConnectionHost(\"localhost:6379\") // Create a connection pool, connect to the given redis server pool := simpleredis.NewConnectionPool() // Use this for connecting to a different redis host/port // pool := simpleredis.NewConnectionPoolHost(\"localhost:6379\") // For connecting to a different redis host/port, with a password // pool := simpleredis.NewConnectionPoolHost(\"password@redishost:6379\") // Close the connection pool right after this function returns defer pool.Close() // Create a list named \"greetings\" list := simpleredis.NewList(pool, \"greetings\") // Add \"hello\" to the list, check if there are errors if list.Add(\"hello\") != nil { log.Fatalln(\"Could not add an item to list!\") } // Get the last item of the list if item, err := list.GetLast(); err != nil { log.Fatalln(\"Could not fetch the last ite","default_branch":null,"files":null,"tree":[],"storefront":"/r/xyproto","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/xyproto/simpleredis/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}