redis

package
v0.0.0-...-86d81c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() redis.Conn

Connect returns redis connection

func DeleteKey

func DeleteKey(key string) (interface{}, error)

func GetHashAll

func GetHashAll(key string) (interface{}, error)

GetHashAll returns redis hash

func GetKey

func GetKey(key string) (interface{}, error)

GetKey returns a redis value

func GetKeys

func GetKeys(pattern string) (interface{}, error)

GetKeys using KEYS redis command with pattern

func GetStringMap

func GetStringMap(result interface{}, err error) (map[string]string, error)

GetStringMap returns a map

func GetStrings

func GetStrings(reply interface{}, err error) ([]string, error)

GetStrings returns a slice of strings

func SetHash

func SetHash(key string, data model.UserModel) (interface{}, error)

SetHash sets a redis hash set

func SetKey

func SetKey(key string, data interface{})

SetKey sets a redis key

Types

type Conn

type Conn struct {
	RedisSession redis.Conn
}

Conn returns redis connection

type User

type User struct {
	ID        int    `json:"id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
	Gender    string `json:"gender"`
}

User Struct is the model for the app

type Users

type Users []User

Users is a slice of User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL