mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
15 lines
425 B
Go
15 lines
425 B
Go
package sessions
|
|
|
|
import "github.com/kataras/iris/config"
|
|
|
|
// New creates & returns a new Manager and start its GC
|
|
func New(cfg ...config.Sessions) *Manager {
|
|
manager, err := newManager(config.DefaultSessions().Merge(cfg))
|
|
if err != nil {
|
|
panic(err.Error()) // we have to panic here because we will start GC after and if provider is nil then many panics will come
|
|
}
|
|
//run the GC here
|
|
go manager.GC()
|
|
return manager
|
|
}
|