Categorygithub.com/gflydev/session/redis
modulepackage
1.0.1
Repository: https://github.com/gflydev/session.git
Documentation: pkg.go.dev

# README

gFly Session - Redis

Use for load balancing

Usage

Install

go get -u github.com/gflydev/[email protected]
go get -u github.com/gflydev/session/[email protected]

Quick usage main.go

import (
    "github.com/gflydev/session"
    sessionRedis "github.com/gflydev/session/redis"	
)

// Setup session
session.Register(sessionRedis.New())
core.RegisterSession(session.New())

Controller (Page/API)

// Set session
c.SetSession("foo", utils.UnsafeStr(utils.RandByte(make([]byte, 128))))

// Get session parameter `foo`
foo := c.GetSession("foo")

# Functions

New returns a new configured redis provider.
NewFailover returns a new redis provider using sentinel to determine the redis server to connect to.
NewFailoverCluster returns a new redis provider using a group of sentinels to determine the redis server to connect to.

# Variables

No description provided by the author
No description provided by the author

# Structs

Config provider settings.
FailoverConfig provider settings.
Provider backend manager.

# Interfaces

Logger implements the upstream redis internal Logger interface.