1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 17:30:50 +00:00

Merge pull request #3443 from zhiquan911/develop

add GetProvider
This commit is contained in:
astaxie 2018-12-18 09:10:17 +08:00 committed by GitHub
commit 98dfb92e17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,15 @@ func Register(name string, provide Provider) {
provides[name] = provide
}
//GetProvider
func GetProvider(name string) (Provider, error) {
provider, ok := provides[name]
if !ok {
return nil, fmt.Errorf("session: unknown provide %q (forgotten import?)", name)
}
return provider, nil
}
// ManagerConfig define the session config
type ManagerConfig struct {
CookieName string `json:"cookieName"`