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

# README

gFly Session

Copyright © 2023, gFly
https://www.gfly.dev
All rights reserved.

gFly Session - Memory

Usage

Install

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

Quick usage main.go

import (
    "github.com/gflydev/session"
    _ "github.com/gflydev/session/memory"	
)

// Setup session
session.Setup()

Controller (Page/API)

// Note: `c` is `*core.Ctx`

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

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

# Packages

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

# Functions

Base64Decode base64 decode.
Base64Encode base64 encode.
MSGPDecode MessagePack decode.
MSGPEncode MessagePack encode.
New create session manager and session adapter.
NewDefaultConfig returns a new default configuration.
NewSession returns a configured manager.
NewStore returns a new empty store.
Register assign session provider type `memory`, `redis`....

# Variables

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

# Structs

Adapter instance for Session with Core.
Config configuration of session manager.
Dict memory store.
Session manages the users sessions.
Store represents the user session.

# Interfaces

No description provided by the author
Provider interface implemented by providers.