Documentation ¶
Index ¶
- func InitSessionManagement(s sessions.Store, us userDAO)
- type Store
- func (s *Store) EndFor(w http.ResponseWriter, r *http.Request, u *user.User) error
- func (s *Store) GetCurrent(r *http.Request) (*user.User, error)
- func (s *Store) GetCurrentCaseProtocol(r *http.Request) (*test.CaseExecutionProtocol, error)
- func (s *Store) GetCurrentSequenceProtocol(r *http.Request) (*test.SequenceExecutionProtocol, error)
- func (s *Store) GetDuration(r *http.Request) (*duration.Duration, error)
- func (s *Store) RemoveCurrentCaseProtocol(w http.ResponseWriter, r *http.Request) error
- func (s *Store) RemoveCurrentSequenceProtocol(w http.ResponseWriter, r *http.Request) error
- func (s *Store) SetCurrentCaseProtocol(w http.ResponseWriter, r *http.Request, protocol *test.CaseExecutionProtocol) error
- func (s *Store) SetCurrentSequenceProtocol(w http.ResponseWriter, r *http.Request, ...) error
- func (s *Store) SetDuration(w http.ResponseWriter, r *http.Request, duration *duration.Duration) error
- func (s *Store) StartFor(w http.ResponseWriter, r *http.Request, user *user.User) error
- type TestStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSessionManagement ¶
InitSessionManagement initialize the global Store. Default parameters are nil, anything else is just for testing
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides functions to store and get data to the session of a request Don't create your own Store! Better get the global Store via the corresponding function
func GetSessionStore ¶
func GetSessionStore() *Store
GetSessionStore returns a pointer to the session-store
func (*Store) EndFor ¶
EndFor removes the user from the session User parameter is not used by now, just for future
func (*Store) GetCurrent ¶
GetCurrent returns the current signed in user to the given request. If the current user is not signed in, the function will return nil, nil If an error occurs nil and the error will be returned
func (*Store) GetCurrentCaseProtocol ¶ added in v0.10.0
GetCurrentCaseProtocol returns the protocol to the currently running case execution to the given request. If there is no case execution running, the function will return nil, nil If an error occurs nil and the error will be returned
func (*Store) GetCurrentSequenceProtocol ¶ added in v0.10.0
func (s *Store) GetCurrentSequenceProtocol(r *http.Request) (*test.SequenceExecutionProtocol, error)
GetCurrentSequenceProtocol returns the protocol to the currently running sequence execution to the given request. If there is no sequence execution running, the function will return nil, nil If an error occurs nil and the error will be returned
func (*Store) GetDuration ¶ added in v0.8.0
GetDuration returns the duration needed in this execution til now. If there is no sequence execution running, the function will return nil, nil If an error occurs nil and the error will be returned
func (*Store) RemoveCurrentCaseProtocol ¶ added in v0.10.0
RemoveCurrentCaseProtocol removes the current case protocol from the session.
func (*Store) RemoveCurrentSequenceProtocol ¶ added in v0.10.0
RemoveCurrentSequenceProtocol removes the current sequence protocol from the session.
func (*Store) SetCurrentCaseProtocol ¶ added in v0.10.0
func (s *Store) SetCurrentCaseProtocol(w http.ResponseWriter, r *http.Request, protocol *test.CaseExecutionProtocol) error
SetCurrentCaseProtocol saves the given protocol to the session. After this call, you can get the current case protocol via the GetCurrentCaseProtocol-function
func (*Store) SetCurrentSequenceProtocol ¶ added in v0.10.0
func (s *Store) SetCurrentSequenceProtocol(w http.ResponseWriter, r *http.Request, protocol *test.SequenceExecutionProtocol) error
SetCurrentSequenceProtocol saves the given protocol to the session. After this call, you can get the current sequence protocol via the GetCurrentSequenceProtocol-function
func (*Store) SetDuration ¶ added in v0.8.0
func (s *Store) SetDuration(w http.ResponseWriter, r *http.Request, duration *duration.Duration) error
SetDuration saves the given duration to the session. After this call, you can get the current duration via the GetDuration-function