session

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 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 {
	Get(sid string) (Session, error)
	Destroy(sid string) error
	GC() error
	SetGCInterval(d time.Duration) 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

func (*MemorySession) Values

func (ms *MemorySession) Values(keys ...string) (values map[string]interface{}, err error)

type MemorySessionManager

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

func NewMemorySessionManager

func NewMemorySessionManager(gcInterval time.Duration) *MemorySessionManager

func (*MemorySessionManager) Destroy

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

func (*MemorySessionManager) GC

func (manager *MemorySessionManager) GC() error

func (*MemorySessionManager) Get

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

func (*MemorySessionManager) SetGCInterval

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

type Session

type Session interface {
	SID() string
	Values(keys ...string) (values map[string]interface{}, err error)
	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