session

package
v0.0.0-...-6a2b0a1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SHA

func SHA(str string) string

Runs a SHA 2 function on the string

Types

type Manager

type Manager struct {
	RedisManager *RedisManager
}

Manager

func NewManager

func NewManager() *Manager

NewManager

func (*Manager) DeleteSession

func (m *Manager) DeleteSession(cookie *http.Cookie) error

DeleteSession

func (*Manager) GetSession

func (m *Manager) GetSession(cookie *http.Cookie) models.Auth

GetSession

func (*Manager) IsLoggedIn

func (m *Manager) IsLoggedIn(r *http.Request) bool

IsLoggedIn

func (*Manager) NewSession

func (m *Manager) NewSession(auth models.Auth) *http.Cookie

NewSession

type RedisManager

type RedisManager struct {
	Client *redis.Client
	Ctx    context.Context
}

RedisManager

func InitRedisClient

func InitRedisClient() *RedisManager

InitRedisClient

func (*RedisManager) Del

func (rm *RedisManager) Del(key string) error

Del

func (*RedisManager) Get

func (rm *RedisManager) Get(key string) (string, error)

Get

func (*RedisManager) Set

func (rm *RedisManager) Set(key string, value string) error

Set

Jump to

Keyboard shortcuts

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