session

package
v0.2.38 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookier

type Cookier interface {
	SetCookies(name, value string, maxAge int, path, domain string, secure, httpOnly bool)
	SetCookie(name, value string)
	Cookie(name string) *lib.Data
	SetCookieByExpire(name, value string, expire int)
}

Cookier

type Session

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

Session

func (*Session) CreateSessionID

func (s *Session) CreateSessionID() string

CreateSessionID

func (*Session) Del

func (s *Session) Del(key string) bool

Del

func (*Session) FlushDB

func (s *Session) FlushDB() bool

FlushDB

func (*Session) Get

func (s *Session) Get(key string, value interface{}) bool

Get

func (*Session) Name

func (s *Session) Name(key string) string

Name

func (*Session) SessionID

func (s *Session) SessionID() string

SessionID

func (*Session) SessionKey added in v0.2.11

func (s *Session) SessionKey() string

SessionKey

func (*Session) Set

func (s *Session) Set(key string, value interface{}) bool

Set

func (*Session) Start

func (s *Session) Start() bool

Start 启动session

type SessionConfig

type SessionConfig struct {
	Name   string `json:"name"`
	Type   string `json:"type"`
	Expire int    `json:"expire"`
	Path   string `json:"path"`
	Prefix string `json:"prefix"`
}

SessionConfig

func (SessionConfig) String

func (s SessionConfig) String() string

String

type Sessioner

type Sessioner interface {
	Set(key string, value interface{}) bool
	Get(key string, value interface{}) bool
	Del(key string) bool
	FlushDB() bool
	Start() bool
	SessionID() string
	SessionKey() string
}

Sessioner

func GetSession

func GetSession(cookie Cookier) Sessioner

GetSession

Jump to

Keyboard shortcuts

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