 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func EnvKey(ctx echo.Context, cfg SessionGuardConfig) string
- func GetLastLoginInfo(ctx echo.Context, ownerType string, ownerId uint64, sessionId string) (*dbschema.NgingLoginLog, error)
- func IgnoreBrowserUA(ctx echo.Context)
- func Unpack(ctx echo.Context, ownerType string, ownerIdOrName interface{}, ...) (password string, err error)
- func UnsetSession(ctx echo.Context, ownerType string)
- func Validate(ctx echo.Context, lastIP string, ownerType string, ownerId uint64) bool
- type Config
- type Environment
- type PE
- type SessionGuardConfig
Constants ¶
      View Source
      
  
const InvalidIPAddress = `invalid ip address`
    Variables ¶
This section is empty.
Functions ¶
func GetLastLoginInfo ¶
func IgnoreBrowserUA ¶ added in v0.6.18
func UnsetSession ¶
Types ¶
type Config ¶ added in v0.6.30
type Config struct {
	SessionGuardConfig
	Frontend *SessionGuardConfig `json:"frontend,omitempty"`
}
    type Environment ¶
type Environment struct {
	UserAgent string                 `json:"ua"`
	Location  ip2regionparser.IpInfo `json:"loc"`
}
    func GetEnvFromSession ¶
func GetEnvFromSession(ctx echo.Context, ownerType string) *Environment
func (*Environment) SetSession ¶
func (e *Environment) SetSession(ctx echo.Context, ownerType string)
type SessionGuardConfig ¶ added in v0.6.30
type SessionGuardConfig struct {
	Expires         int64 `json:"expires"`
	IgnoreBrowserUA bool  `json:"ignoreBrowserUA"`
	IgnoreBrowserIP bool  `json:"ignoreBrowserIP"`
}
    func (*SessionGuardConfig) VerifyEnvKey ¶ added in v0.6.30
 Click to show internal directories. 
   Click to hide internal directories.