Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOverseerRunning = errors.New("the overseer is already running")
Returned if overseer is running and it is called again.
View Source
var ErrValueNotSet = errors.New("this session variable was not set")
Returned if a session value is accessed but not set
Functions ¶
func RunOverseer ¶
func RunOverseer() error
Runs overseer 1 time if AutoOverseer is disabled and infinitely if it is enabled. This option can be changed at any point.
Types ¶
type Session ¶
type Session sesTable
Used for users wanting to interact with sessions.
func GetSession ¶
func GetSession(w http.ResponseWriter, r *http.Request) *Session
GetSession returns a Session for the current user. If a session does not exist, one will be created and returned.
func (*Session) ExpandShortSession ¶
func (ses *Session) ExpandShortSession()
Refresh the expiration of a short lifespan session. You only need to use this if Settings.AutoExpandShortSes = false.
type SettingsStruct ¶
type SettingsStruct struct { SessionLength time.Duration //The length of a session. UseShortAuth bool //Enable short lifespan session authentication. ShortLength time.Duration //The length of the short lifespan session AutoExpandShortSes bool //Expands short session every time getSession is called. AutoOverseer bool //Specify if overseer should run automatically. Note that if you disable thing, you will have to call RunOverseer() again. OverseerInterval time.Duration //Specify the interval in which overseer is run if AutoOverseer is true ValidateRemoteAddr bool //Validates sessions by using the Remote Address. VerboseErrors bool //Logs internal errors for invalid sessions. }
SettingsStruct is a struct used to set the settings of cygses.
var Settings SettingsStruct
Stores settings for the entire library to interact with
Click to show internal directories.
Click to hide internal directories.