1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-04 02:37:14 +00:00

Expose a standard Session interface on context/context.go | https://github.com/kataras/iris/issues/316

This commit is contained in:
Gerasimos Maropoulos
2016-07-26 19:36:31 +03:00
parent 5579153614
commit 3f13707428
2 changed files with 15 additions and 22 deletions

View File

@@ -9,6 +9,19 @@ import (
)
type (
// Session is the domain-level session's store interface
// it's synced with the iris/sessions.go:session
Session interface {
ID() string
Get(string) interface{}
GetString(key string) string
GetInt(key string) int
GetAll() map[string]interface{}
VisitAll(cb func(k string, v interface{}))
Set(string, interface{})
Delete(string)
Clear()
}
// IContext the interface for the iris/context
// Used mostly inside packages which shouldn't be import ,directly, the kataras/iris.
@@ -71,17 +84,7 @@ type (
GetFlashes() map[string]string
GetFlash(string) (string, error)
SetFlash(string, string)
Session() interface {
ID() string
Get(string) interface{}
GetString(key string) string
GetInt(key string) int
GetAll() map[string]interface{}
VisitAll(cb func(k string, v interface{}))
Set(string, interface{})
Delete(string)
Clear()
}
Session() Session
SessionDestroy()
Log(string, ...interface{})
Reset(*fasthttp.RequestCtx)