RedisSessionData

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultSession

func GetDefaultSession() string

Types

type RedisSessionDataType

type RedisSessionDataType struct {
	RawData     string
	SessionData RedisSessionParse

	Prefix string
	Key    string
	// contains filtered or unexported fields
}

func NewRedisSesionDataType

func NewRedisSesionDataType() *RedisSessionDataType

func (*RedisSessionDataType) CreateDefaultSession

func (sd *RedisSessionDataType) CreateDefaultSession() (ss string)

session = rw.Session.CreateDefaultSession()

func (*RedisSessionDataType) DumpData

func (sd *RedisSessionDataType) DumpData() (rv string)

x := rw.Session.DumpData()

func (*RedisSessionDataType) FlushSessionToRedis

func (sd *RedisSessionDataType) FlushSessionToRedis()

func (p *Pool) Get() (*redis.Client, error) { rw.Session.FlushSessionToRedis()

func (*RedisSessionDataType) GetData

func (sd *RedisSessionDataType) GetData(grp, name string) (dv string, err error)

func (*RedisSessionDataType) GetFreeRedisConn

func (sd *RedisSessionDataType) GetFreeRedisConn(GetConn func() (*redis.Client, error), PutConn func(*redis.Client)) *RedisSessionDataType

func (*RedisSessionDataType) GetSessionFromRedis

func (sd *RedisSessionDataType) GetSessionFromRedis() (ss string)

session = rw.Session.GetSessionFromRedis()

func (*RedisSessionDataType) IsDirty

func (sd *RedisSessionDataType) IsDirty() bool

func (*RedisSessionDataType) Login

func (sd *RedisSessionDataType) Login()

func (*RedisSessionDataType) Logout

func (sd *RedisSessionDataType) Logout()

func (*RedisSessionDataType) SetData

func (sd *RedisSessionDataType) SetData(grp, name, value string)

func (*RedisSessionDataType) SetDirty

func (*RedisSessionDataType) SetPrefixKey

func (sd *RedisSessionDataType) SetPrefixKey(Prefix, Key string) *RedisSessionDataType

func (*RedisSessionDataType) SetRule

func (sd *RedisSessionDataType) SetRule(name string, temp, user bool)

type RedisSessionParse

type RedisSessionParse struct {
	IsLoggedIn  bool                `json:"$is_logged_in$"`
	UserData    map[string]string   `json:"UserData"`
	RegularData map[string]string   `json:"RegularData"`
	Rules       map[string]RuleType `json:"Rules"`
}

type RuleType

type RuleType struct {
	Temporary  bool `json:"temporary"`
	UserMaySet bool `json:"user_may_set"`
}

Jump to

Keyboard shortcuts

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