goauthredis

package
v0.0.0-...-c36fa23 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseConn

func CloseConn(rc *RedisClient) error

CloseConn close the connection to Redis

Types

type RedisClient

type RedisClient struct {
	// contains filtered or unexported fields
}

RedisClient represents the Redis client

func StartRedis

func StartRedis(redisAddr string, pass string) (*RedisClient, error)

StartRedis start the connection to redis and return the client

func (*RedisClient) DeleteSession

func (rc *RedisClient) DeleteSession(token string) (string, error)

DeleteSession delete the session from Redis

func (*RedisClient) InsertUser

func (rc *RedisClient) InsertUser(username string) error

InsertUser insert new username into users list

func (*RedisClient) RetreiveAllUsers

func (rc *RedisClient) RetreiveAllUsers() ([]string, error)

RetreiveAllUsers retreive all users from redis user list

func (*RedisClient) RetreiveSession

func (rc *RedisClient) RetreiveSession(token string) (string, error)

RetreiveSession retreive user from token

func (*RedisClient) SaveSession

func (rc *RedisClient) SaveSession(username string) (string, error)

SaveSession save current session in Redis

func (*RedisClient) SaveUsers

func (rc *RedisClient) SaveUsers(usernameArr *[]string) error

SaveUsers save users to Redis

func (*RedisClient) SetCookie

func (rc *RedisClient) SetCookie(w http.ResponseWriter, token string)

SetCookie set cookie for client

Jump to

Keyboard shortcuts

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