Files
gf/os/gsession/gsession.go

29 lines
843 B
Go
Raw Normal View History

2021-01-17 21:46:25 +08:00
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
// Package gsession implements manager and storage features for sessions.
package gsession
import (
2021-10-11 21:41:56 +08:00
"github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/util/guid"
)
var (
2021-09-19 10:18:58 +08:00
// ErrorDisabled is used for marking certain interface function not used.
2023-12-04 19:34:48 +08:00
ErrorDisabled = gerror.NewWithOption(gerror.Option{
2021-07-20 23:02:02 +08:00
Text: "this feature is disabled in this storage",
Code: gcode.CodeNotSupported,
2021-07-20 23:02:02 +08:00
})
)
// NewSessionId creates and returns a new and unique session id string,
// which is in 32 bytes.
func NewSessionId() string {
2020-05-16 22:08:16 +08:00
return guid.S()
}