Files
Atay-Makhzan/modules/session/store.go
T

25 lines
621 B
Go
Raw Normal View History

2021-01-26 23:36:53 +08:00
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package session
2021-12-20 14:12:26 +00:00
import (
"net/http"
"gitea.com/go-chi/session"
)
2021-01-26 23:36:53 +08:00
// Store represents a session store
type Store interface {
Get(interface{}) interface{}
Set(interface{}, interface{}) error
Delete(interface{}) error
}
2021-12-20 14:12:26 +00:00
// RegenerateSession regenerates the underlying session and returns the new store
func RegenerateSession(resp http.ResponseWriter, req *http.Request) (Store, error) {
s, err := session.RegenerateSession(resp, req)
return s, err
}