Documentation ¶
Overview ¶
Package sess manages user registrations, records, and sessions. Copyright © 2018 Zelenko. All rights reserved.
Index ¶
- type SManager
- func (sm *SManager) Close()
- func (sm *SManager) LoginSession(un, br, ipAddr string) string
- func (sm *SManager) RandomSession() string
- func (sm *SManager) RegisterUser(un, pw string)
- func (sm *SManager) ShowSessions(userID string) []string
- func (sm *SManager) ShowUsers() []string
- func (sm *SManager) UpdateSession(id string)
- func (sm *SManager) ValidateUser(id string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SManager ¶
type SManager string
SManager exported type is used by methods
func (*SManager) Close ¶
func (sm *SManager) Close()
Close method saves all user and session records into text file. These saved records are loaded into memory next time server runs.
func (*SManager) LoginSession ¶
LoginSession return session id
func (*SManager) RandomSession ¶
RandomSession generates new random session ID
func (*SManager) RegisterUser ¶
RegisterUser creates a new user
func (*SManager) ShowSessions ¶
ShowSessions returns slice of sessions
func (*SManager) UpdateSession ¶
UpdateSession sets lastActive date and time
func (*SManager) ValidateUser ¶
ValidateUser checks if user is registered
Click to show internal directories.
Click to hide internal directories.