session

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

session

Session manager

for echo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultSession

type DefaultSession struct {
	M map[string]interface{}
	// contains filtered or unexported fields
}

func (DefaultSession) Agent

func (s DefaultSession) Agent() string

func (DefaultSession) Destroy

func (s DefaultSession) Destroy()

func (*DefaultSession) ExpiresAt

func (s *DefaultSession) ExpiresAt(nano int64)

func (*DefaultSession) Extend

func (s *DefaultSession) Extend(duration time.Duration)

func (DefaultSession) Get

func (s DefaultSession) Get(k string) (interface{}, bool)

func (DefaultSession) IPAddress

func (s DefaultSession) IPAddress() string

func (DefaultSession) IsExpired

func (s DefaultSession) IsExpired() bool

Returns true if the item has expired.

func (DefaultSession) Key

func (s DefaultSession) Key() string

func (DefaultSession) MustGet

func (s DefaultSession) MustGet(k string) interface{}

func (*DefaultSession) Remove

func (s *DefaultSession) Remove(k string)

func (*DefaultSession) Save

func (s *DefaultSession) Save()

func (*DefaultSession) Set

func (s *DefaultSession) Set(k string, o interface{})

func (*DefaultSession) Store

func (s *DefaultSession) Store() Store

type Session

type Session interface {
	Key() string
	Get(key string) (interface{}, bool)
	MustGet(key string) interface{}
	Set(key string, o interface{})
	Save()
	IsExpired() bool
	ExpiresAt(nano int64)
	Store() Store
	Remove(key string)
	Extend(duration time.Duration)
	Destroy()
	IPAddress() string
	Agent() string
}

func New

func New(id string, store Store, ipAddress string, agent string) Session

type Store

type Store interface {
	GetNew(args ...string) Session
	Get(id string) (Session, bool)
	Set(session Session)
	Delete(key string)
	Sessions() StoreMap
	Count() int
}

type StoreMap

type StoreMap map[string]Session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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