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: 0

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