session

package
v1.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieSIDStore added in v0.9.3

type CookieSIDStore struct {
	CookieName string
}

A CookieSIDStore to store sid by http cookie

func (*CookieSIDStore) Get added in v0.9.3

func (s *CookieSIDStore) Get(r *http.Request) string

Get return sid by http cookie

func (*CookieSIDStore) Put added in v0.9.3

func (s *CookieSIDStore) Put(w http.ResponseWriter, sid string)

Put sets sid by http cookie

type MemorySession

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

func (*MemorySession) Delete

func (ms *MemorySession) Delete(key string) error

func (*MemorySession) Flush

func (ms *MemorySession) Flush() error

func (*MemorySession) Get

func (ms *MemorySession) Get(key string) (value []byte, err error)

func (*MemorySession) Has

func (ms *MemorySession) Has(key string) (ok bool, err error)

func (*MemorySession) SID

func (ms *MemorySession) SID() string

func (*MemorySession) Set

func (ms *MemorySession) Set(key string, value []byte) error

type MemorySessionPool added in v0.6.1

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

func NewMemorySessionPool added in v0.6.1

func NewMemorySessionPool(lifetime time.Duration) *MemorySessionPool

func (*MemorySessionPool) Destroy added in v0.6.1

func (pool *MemorySessionPool) Destroy(sid string) error

func (*MemorySessionPool) GetSession added in v0.6.1

func (pool *MemorySessionPool) GetSession(sid string) (session Session, err error)

type Pool added in v0.6.1

type Pool interface {
	GetSession(sid string) (Session, error)
	Destroy(sid string) error
}

A Pool to handle sessions

type SIDStore added in v0.9.3

type SIDStore interface {
	Get(r *http.Request) string
	Put(w http.ResponseWriter, sid string)
}

A SIDStore to store sid

type Session

type Session interface {
	SID() string
	Has(key string) (ok bool, err error)
	Get(key string) (value []byte, err error)
	Set(key string, value []byte) error
	Delete(key string) error
	Flush() error
}

Session for http server

Jump to

Keyboard shortcuts

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