1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 21:15:56 +00:00

Update to version 8.5.5 | Read HISTORY.md

Former-commit-id: dced7d472edabbab4f80c76051f13261928a8dea
This commit is contained in:
kataras
2017-11-02 05:54:33 +02:00
parent 666bcacf20
commit 15feaf0237
100 changed files with 13338 additions and 13155 deletions

View File

@@ -1,4 +1,4 @@
# This is the official list of Iris Sessions authors for copyright
# purposes.
Gerasimos Maropoulos <kataras2006@hotmail.com>
# This is the official list of Iris Sessions authors for copyright
# purposes.
Gerasimos Maropoulos <kataras2006@hotmail.com>

View File

@@ -1,27 +1,27 @@
Copyright (c) 2017 The Iris Sessions Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Iris nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Copyright (c) 2017 The Iris Sessions Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Iris nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -14,7 +14,7 @@ import (
// DefaultFileMode used as the default database's "fileMode"
// for creating the sessions directory path, opening and write the session file.
var (
DefaultFileMode = 0666
DefaultFileMode = 0755
)
// Database the badger(key-value file-based) session storage.
@@ -23,7 +23,6 @@ type Database struct {
// it's initialized at `New` or `NewFromDB`.
// Can be used to get stats.
Service *badger.DB
async bool
}
// New creates and returns a new badger(key-value file-based) storage
@@ -109,10 +108,9 @@ func (db *Database) Cleanup() (err error) {
return rep.Return()
}
// Async if true passed then it will use different
// go routines to update the badger(key-value file-based) storage.
// Async is DEPRECATED
// if it was true then it could use different to update the back-end storage, now it does nothing.
func (db *Database) Async(useGoRoutines bool) *Database {
db.async = useGoRoutines
return db
}
@@ -146,11 +144,7 @@ func (db *Database) Load(sid string) (storeDB sessions.RemoteStore) {
// Sync syncs the database with the session's (memory) store.
func (db *Database) Sync(p sessions.SyncPayload) {
if db.async {
go db.sync(p)
} else {
db.sync(p)
}
db.sync(p)
}
func (db *Database) sync(p sessions.SyncPayload) {

View File

@@ -17,7 +17,7 @@ import (
// for creating the sessions directory path, opening and write
// the session boltdb(file-based) storage.
var (
DefaultFileMode = 0666
DefaultFileMode = 0755
)
// Database the BoltDB(file-based) session storage.
@@ -27,7 +27,6 @@ type Database struct {
// it's initialized at `New` or `NewFromDB`.
// Can be used to get stats.
Service *bolt.DB
async bool
}
var (
@@ -115,10 +114,9 @@ func (db *Database) Cleanup() error {
return err
}
// Async if true passed then it will use different
// go routines to update the BoltDB(file-based) storage.
// Async is DEPRECATED
// if it was true then it could use different to update the back-end storage, now it does nothing.
func (db *Database) Async(useGoRoutines bool) *Database {
db.async = useGoRoutines
return db
}
@@ -151,11 +149,7 @@ func (db *Database) Load(sid string) (storeDB sessions.RemoteStore) {
// Sync syncs the database with the session's (memory) store.
func (db *Database) Sync(p sessions.SyncPayload) {
if db.async {
go db.sync(p)
} else {
db.sync(p)
}
db.sync(p)
}
func (db *Database) sync(p sessions.SyncPayload) {

View File

@@ -13,7 +13,7 @@ import (
// DefaultFileMode used as the default database's "fileMode"
// for creating the sessions directory path, opening and write the session file.
var (
DefaultFileMode = 0666
DefaultFileMode = 0755
)
// Database is the basic file-storage session database.
@@ -28,12 +28,7 @@ var (
// Remember: sessions are not a storage for large data, everywhere: on any platform on any programming language.
type Database struct {
dir string
fileMode os.FileMode // defaults to 0666 if missing.
// if true then it will use go routines to:
// append or re-write a file
// create a file
// remove a file
async bool
fileMode os.FileMode // defaults to DefaultFileMode if missing.
}
// New creates and returns a new file-storage database instance based on the "directoryPath".
@@ -77,20 +72,15 @@ func (db *Database) Cleanup() error {
// FileMode for creating the sessions directory path, opening and write the session file.
//
// Defaults to 0666.
// Defaults to 0755.
func (db *Database) FileMode(fileMode uint32) *Database {
db.fileMode = os.FileMode(fileMode)
return db
}
// Async if true passed then it will use go routines to:
// append or re-write a file
// create a file
// remove a file.
//
// Defaults to false.
// Async is DEPRECATED
// if it was true then it could use different to update the back-end storage, now it does nothing.
func (db *Database) Async(useGoRoutines bool) *Database {
db.async = useGoRoutines
return db
}
@@ -137,11 +127,7 @@ func (db *Database) load(fileName string) (storeDB sessions.RemoteStore, loadErr
// Sync syncs the database.
func (db *Database) Sync(p sessions.SyncPayload) {
if db.async {
go db.sync(p)
} else {
db.sync(p)
}
db.sync(p)
}
func (db *Database) sync(p sessions.SyncPayload) {

View File

@@ -27,7 +27,6 @@ type Database struct {
// it's initialized at `New` or `NewFromDB`.
// Can be used to get stats.
Service *leveldb.DB
async bool
}
// New creates and returns a new LevelDB(file-based) storage
@@ -98,10 +97,9 @@ func (db *Database) Cleanup() error {
return iter.Error()
}
// Async if true passed then it will use different
// go routines to update the LevelDB(file-based) storage.
// Async is DEPRECATED
// if it was true then it could use different to update the back-end storage, now it does nothing.
func (db *Database) Async(useGoRoutines bool) *Database {
db.async = useGoRoutines
return db
}
@@ -140,11 +138,7 @@ func (db *Database) Load(sid string) (storeDB sessions.RemoteStore) {
// Sync syncs the database with the session's (memory) store.
func (db *Database) Sync(p sessions.SyncPayload) {
if db.async {
go db.sync(p)
} else {
db.sync(p)
}
db.sync(p)
}
func (db *Database) sync(p sessions.SyncPayload) {

View File

@@ -12,7 +12,6 @@ import (
// Database the redis back-end session database for the sessions.
type Database struct {
redis *service.Service
async bool
}
// New returns a new redis database.
@@ -27,10 +26,9 @@ func (db *Database) Config() *service.Config {
return db.redis.Config
}
// Async if true passed then it will use different
// go routines to update the redis storage.
// Async is DEPRECATED
// if it was true then it could use different to update the back-end storage, now it does nothing.
func (db *Database) Async(useGoRoutines bool) *Database {
db.async = useGoRoutines
return db
}
@@ -70,11 +68,7 @@ func (db *Database) Load(sid string) (storeDB sessions.RemoteStore) {
// Sync syncs the database.
func (db *Database) Sync(p sessions.SyncPayload) {
if db.async {
go db.sync(p)
} else {
db.sync(p)
}
db.sync(p)
}
func (db *Database) sync(p sessions.SyncPayload) {