sess

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 8 Imported by: 1

README

Пакет управления и хранения сессионных данных для HTTP

https://wiki.leolab.info/prj/libs/go/sess/

Зависимости

Documentation

Index

Constants

View Source
const (
	Version = "0.1.3-dev"
)

Variables

View Source
var (
	//ErrNoConfig   errs.ErrCode = "NoConfigError"
	ErrCookie         errs.ErrCode = "CookieError"
	ErrCookieHash     errs.ErrCode = "CookieHashError"
	ErrSessionExpired errs.ErrCode = "ErrSessionExpired"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	CookieName   string
	CookieTime   time.Duration
	CookiePath   string
	CookieDomain string
	ClearTime    time.Duration
}

Параметры экземпляра

0.1.0

type Rec

type Rec struct {
	SSID    string
	Hash    string
	Expired time.Time
	Data    map[string]interface{}
}

Запись сессии

0.1.0

type Store

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

Объект хранилища cookie

0.1.0

func NewStore

func NewStore(cfg *Config) (*Store, *errs.Err)

Создание хранилища

0.1.0

func (*Store) Get

func (s *Store) Get(w http.ResponseWriter, r *http.Request) (*Rec, *errs.Err)

Получить или создать данные сессии

0.1.0

func (*Store) Init

func (s *Store) Init() *errs.Err

Инициализация хранилища

0.1.0

func (*Store) Start

func (s *Store) Start()

Запуск процессов хранилища

0.1.0

func (*Store) Stop

func (s *Store) Stop()

Останов процессов хранилища

0.1.0

Jump to

Keyboard shortcuts

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