Documentation
¶
Index ¶
- Constants
- func NewCloseUserSessionsUsecase(store SessionStorage, listUserSessions *ListUserSessionsUsecase, ...) happydns.SessionCloserUsecase
- func NewSessionId() string
- type CloseUserSessionsUsecase
- type CreateUserSessionUsecase
- type DeleteUserSessionUsecase
- type GetUserSessionUsecase
- type ListUserSessionsUsecase
- type Service
- func (s *Service) CloseUserSessions(user *happydns.User) error
- func (s *Service) CreateUserSession(user *happydns.User, description string) (*happydns.Session, error)
- func (s *Service) DeleteUserSession(user *happydns.User, sessionID string) error
- func (s *Service) GetUserSession(user *happydns.User, sessionID string) (*happydns.Session, error)
- func (s *Service) ListUserSessions(user *happydns.User) ([]*happydns.Session, error)
- func (s *Service) UpdateUserSession(user *happydns.User, sessionID string, updateFunc func(sess *happydns.Session)) error
- type SessionStorage
- type UpdateUserSessionUsecase
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func NewCloseUserSessionsUsecase ¶
func NewCloseUserSessionsUsecase( store SessionStorage, listUserSessions *ListUserSessionsUsecase, deleteUserSession *DeleteUserSessionUsecase, ) happydns.SessionCloserUsecase
Types ¶
type CloseUserSessionsUsecase ¶
type CloseUserSessionsUsecase struct {
// contains filtered or unexported fields
}
func (*CloseUserSessionsUsecase) ByID ¶
func (uc *CloseUserSessionsUsecase) ByID(userID happydns.Identifier) error
func (*CloseUserSessionsUsecase) CloseAll ¶
func (uc *CloseUserSessionsUsecase) CloseAll(user happydns.UserInfo) error
type CreateUserSessionUsecase ¶
type CreateUserSessionUsecase struct {
// contains filtered or unexported fields
}
func NewCreateUserSessionUsecase ¶
func NewCreateUserSessionUsecase(store SessionStorage) *CreateUserSessionUsecase
func (*CreateUserSessionUsecase) Create ¶
func (uc *CreateUserSessionUsecase) Create(user *happydns.User, description string) (*happydns.Session, error)
type DeleteUserSessionUsecase ¶
type DeleteUserSessionUsecase struct {
// contains filtered or unexported fields
}
func NewDeleteUserSessionUsecase ¶
func NewDeleteUserSessionUsecase(store SessionStorage, getUserSession *GetUserSessionUsecase) *DeleteUserSessionUsecase
func (*DeleteUserSessionUsecase) Delete ¶
func (uc *DeleteUserSessionUsecase) Delete(user *happydns.User, sessionID string) error
type GetUserSessionUsecase ¶
type GetUserSessionUsecase struct {
// contains filtered or unexported fields
}
func NewGetUserSessionUsecase ¶
func NewGetUserSessionUsecase(store SessionStorage) *GetUserSessionUsecase
func (*GetUserSessionUsecase) Get ¶
func (uc *GetUserSessionUsecase) Get(user *happydns.User, sessionID string) (*happydns.Session, error)
type ListUserSessionsUsecase ¶
type ListUserSessionsUsecase struct {
// contains filtered or unexported fields
}
func NewListUserSessionsUsecase ¶
func NewListUserSessionsUsecase(store SessionStorage) *ListUserSessionsUsecase
func (*ListUserSessionsUsecase) List ¶
func (uc *ListUserSessionsUsecase) List(user happydns.UserInfo) ([]*happydns.Session, error)
type Service ¶
type Service struct {
CreateUserSessionUC *CreateUserSessionUsecase
DeleteUserSessionUC *DeleteUserSessionUsecase
GetUserSessionUC *GetUserSessionUsecase
ListUserSessionsUC *ListUserSessionsUsecase
UpdateUserSessionUC *UpdateUserSessionUsecase
CloseUserSessionsUC happydns.SessionCloserUsecase
}
func NewSessionUsecases ¶
func NewSessionUsecases(store SessionStorage) *Service
func (*Service) CreateUserSession ¶
func (*Service) DeleteUserSession ¶
func (*Service) GetUserSession ¶
func (*Service) ListUserSessions ¶
type SessionStorage ¶
type SessionStorage interface {
// ListAllSessions retrieves the list of known Sessions.
ListAllSessions() (happydns.Iterator[happydns.Session], error)
// GetSession retrieves the Session with the given identifier.
GetSession(sessionid string) (*happydns.Session, error)
// ListAuthUserSessions retrieves all Session for the given AuthUser.
ListAuthUserSessions(user *happydns.UserAuth) ([]*happydns.Session, error)
// ListUserSessions retrieves all Session for the given User.
ListUserSessions(userid happydns.Identifier) ([]*happydns.Session, error)
// UpdateSession updates the fields of the given Session.
UpdateSession(session *happydns.Session) error
// DeleteSession removes the given Session from the database.
DeleteSession(sessionid string) error
// ClearSessions deletes all Sessions present in the database.
ClearSessions() error
}
type UpdateUserSessionUsecase ¶
type UpdateUserSessionUsecase struct {
// contains filtered or unexported fields
}
func NewUpdateUserSessionUsecase ¶
func NewUpdateUserSessionUsecase(store SessionStorage, getUserSession *GetUserSessionUsecase) *UpdateUserSessionUsecase
func (*UpdateUserSessionUsecase) Update ¶
func (uc *UpdateUserSessionUsecase) Update( user *happydns.User, sessionID string, updateFunc func(sess *happydns.Session), ) error
Source Files
¶
- close_user_sessions.go
- create_user_session.go
- delete_user_session.go
- factory.go
- get_user_session.go
- list_user_sessions.go
- session_storage.go
- update_user_session.go
Click to show internal directories.
Click to hide internal directories.