session

package
v0.0.0-...-3b0718c Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILE_SESSION  = "file"
	REDIS_SESSION = "redis"
)

Variables

View Source
var (
	SESS_ID string
)

Functions

This section is empty.

Types

type FileSession

type FileSession struct {
	SessPath string

	SessionManager
}

func (*FileSession) CloseSession

func (this *FileSession) CloseSession(ctx *context.Context)

func (*FileSession) GC

func (this *FileSession) GC()

func (*FileSession) Get

func (this *FileSession) Get(ctx *context.Context, key string) interface{}

func (*FileSession) GetSession

func (this *FileSession) GetSession(ctx *context.Context) (Session, error)

func (*FileSession) GetSessionFilePath

func (this *FileSession) GetSessionFilePath(id string) string

func (*FileSession) OpenSession

func (this *FileSession) OpenSession(ctx *context.Context)

func (*FileSession) Set

func (this *FileSession) Set(ctx *context.Context, key string, value interface{})

func (*FileSession) SetSession

func (this *FileSession) SetSession(ctx *context.Context, session Session)

func (*FileSession) UpdateSession

func (this *FileSession) UpdateSession(ctx *context.Context)

type RedisSession

type RedisSession struct {
	SessionManager
}

type Session

type Session struct {
	SessID           string                 `json:"sessid"`
	LastTimeAccessed int64                  `json:"lsttm"`
	Values           map[string]interface{} `json:"values"`
}

func NewSessionObject

func NewSessionObject() *Session

type SessionManager

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

func (*SessionManager) CloseSession

func (this *SessionManager) CloseSession(ctx *context.Context)

func (*SessionManager) GC

func (this *SessionManager) GC()

func (*SessionManager) Get

func (this *SessionManager) Get(ctx *context.Context, key string) interface{}

func (*SessionManager) GetSession

func (this *SessionManager) GetSession(ctx *context.Context) (Session, error)

func (*SessionManager) LoadCookieValue

func (this *SessionManager) LoadCookieValue(ctx *context.Context) string

func (*SessionManager) NewSessionID

func (this *SessionManager) NewSessionID() (string, error)

func (*SessionManager) OpenSession

func (this *SessionManager) OpenSession(ctx *context.Context)

func (*SessionManager) Set

func (this *SessionManager) Set(ctx *context.Context, key string, value interface{})

func (*SessionManager) SetSession

func (this *SessionManager) SetSession(ctx *context.Context, session Session)

func (*SessionManager) UpdateSession

func (this *SessionManager) UpdateSession(ctx *context.Context)

type SessionMgrInterface

type SessionMgrInterface interface {
	OpenSession(ctx *context.Context)
	CloseSession(ctx *context.Context)
	SetSession(ctx *context.Context, session Session)
	Set(ctx *context.Context, key string, value interface{})
	GetSession(ctx *context.Context) (Session, error)
	Get(ctx *context.Context, key string) interface{}
	UpdateSession(ctx *context.Context)
	GC()
}

func NewSessionManager

func NewSessionManager(sess_type string, iMaxlife int64, ext_params map[string]interface{}) SessionMgrInterface

Jump to

Keyboard shortcuts

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