session

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	CookieName() string
	GetSession(sid string) (Session, error)
	SetLifetime(d time.Duration) error
	GC() error
	Destroy(sid string) error
}

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 interface{}, 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 interface{}) error

type MemorySessionManager

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

func NewMemorySessionManager

func NewMemorySessionManager(lifetime time.Duration) *MemorySessionManager

func (*MemorySessionManager) CookieName added in v0.5.0

func (manager *MemorySessionManager) CookieName() string

func (*MemorySessionManager) Destroy

func (manager *MemorySessionManager) Destroy(sid string) error

func (*MemorySessionManager) GC

func (manager *MemorySessionManager) GC() error

func (*MemorySessionManager) GetSession added in v0.5.0

func (manager *MemorySessionManager) GetSession(sid string) (session Session, err error)

func (*MemorySessionManager) SetLifetime added in v0.5.0

func (manager *MemorySessionManager) SetLifetime(lifetime time.Duration) error

type Session

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

Jump to

Keyboard shortcuts

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