Skip to content

danielmarzini/redisorm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Redis wrapper for Golang

Installation

go get github.com/ausrasul/redisorm

Usage:

Use this library to directly save structs to Redis and get structs from Redis. Connection pool management is built in.

Usage example:

package main

import (
   "github.com/ausrasul/redisorm"
)

type User struct {
	Name string
	Id   int
}

user := &User{
	Name: "test",
	Id: 1,
}
func main(){
	// Configure the package
	
	redisorm.Configure(
		map[string]interface{}{
			"poolMaxIdle":   10,
			"poolMaxActive": 60,
			"port":          "6379",
		},
	)
	
	err := redisorm.Set(user.Name, user)  // user.Name is just a key
	err := redisorm.Get(user.Name, user)
	//handle errors.
	return err
}

About

Golang client for Redis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%