Documentation
¶
Index ¶
- type AccountsUseCase
- func (u AccountsUseCase) Create(ctx context.Context, userID string, request types.CreateAccountRequest) (*models.Account, error)
- func (u AccountsUseCase) Delete(ctx context.Context, accountID string) error
- func (u AccountsUseCase) GetByID(ctx context.Context, accountID string) (*models.Account, error)
- func (u AccountsUseCase) GetByUserID(ctx context.Context, userID string) ([]models.Account, error)
- func (u AccountsUseCase) Update(ctx context.Context, accountID string, request types.UpdateAccountRequest) (*models.Account, error)
- type AdminUseCases
- func (u *AdminUseCases) AccountsUseCase() AccountsUseCase
- func (u *AdminUseCases) BanUser(ctx context.Context, userID string, request types.BanUserRequest, ...) (*types.AdminUserState, error)
- func (u *AdminUseCases) CreateAccount(ctx context.Context, userID string, request types.CreateAccountRequest) (*models.Account, error)
- func (u *AdminUseCases) CreateSessionState(ctx context.Context, sessionID string, request types.CreateSessionStateRequest, ...) (*types.AdminSessionState, error)
- func (u *AdminUseCases) CreateUser(ctx context.Context, request types.CreateUserRequest) (*models.User, error)
- func (u *AdminUseCases) CreateUserState(ctx context.Context, userID string, request types.CreateUserStateRequest, ...) (*types.AdminUserState, error)
- func (u *AdminUseCases) DeleteAccount(ctx context.Context, accountID string) error
- func (u *AdminUseCases) DeleteSessionState(ctx context.Context, sessionID string) error
- func (u *AdminUseCases) DeleteUser(ctx context.Context, userID string) error
- func (u *AdminUseCases) DeleteUserState(ctx context.Context, userID string) error
- func (u *AdminUseCases) GetAccountByID(ctx context.Context, accountID string) (*models.Account, error)
- func (u *AdminUseCases) GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)
- func (u *AdminUseCases) GetAllUsers(ctx context.Context, cursor *string, limit int) (*types.UsersPage, error)
- func (u *AdminUseCases) GetBannedUserStates(ctx context.Context) ([]types.AdminUserState, error)
- func (u *AdminUseCases) GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)
- func (u *AdminUseCases) GetRevokedSessionStates(ctx context.Context) ([]types.AdminSessionState, error)
- func (u *AdminUseCases) GetSessionState(ctx context.Context, sessionID string) (*types.AdminSessionState, error)
- func (u *AdminUseCases) GetUserAccounts(ctx context.Context, userID string) ([]models.Account, error)
- func (u *AdminUseCases) GetUserAdminSessions(ctx context.Context, userID string) ([]types.AdminUserSession, error)
- func (u *AdminUseCases) GetUserByID(ctx context.Context, userID string) (*models.User, error)
- func (u *AdminUseCases) GetUserState(ctx context.Context, userID string) (*types.AdminUserState, error)
- func (u *AdminUseCases) ImpersonationUseCase() ImpersonationUseCase
- func (u *AdminUseCases) RevokeSession(ctx context.Context, sessionID string, reason *string, actorUserID *string) (*types.AdminSessionState, error)
- func (u *AdminUseCases) StartImpersonation(ctx context.Context, actorUserID string, actorSessionID *string, ...) (*types.StartImpersonationResult, error)
- func (u *AdminUseCases) StateUseCase() StateUseCase
- func (u *AdminUseCases) StopImpersonation(ctx context.Context, impersonatedUserID string, impersonatedSessionID string, ...) error
- func (u *AdminUseCases) UnbanUser(ctx context.Context, userID string) (*types.AdminUserState, error)
- func (u *AdminUseCases) UpdateAccount(ctx context.Context, accountID string, request types.UpdateAccountRequest) (*models.Account, error)
- func (u *AdminUseCases) UpdateSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, ...) (*types.AdminSessionState, error)
- func (u *AdminUseCases) UpdateUser(ctx context.Context, userID string, request types.UpdateUserRequest) (*models.User, error)
- func (u *AdminUseCases) UpdateUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, ...) (*types.AdminUserState, error)
- func (u *AdminUseCases) UpsertSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, ...) (*types.AdminSessionState, error)
- func (u *AdminUseCases) UpsertUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, ...) (*types.AdminUserState, error)
- func (u *AdminUseCases) UsersUseCase() UsersUseCase
- type ImpersonationUseCase
- func (u ImpersonationUseCase) GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)
- func (u ImpersonationUseCase) GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)
- func (u ImpersonationUseCase) StartImpersonation(ctx context.Context, actorUserID string, actorSessionID *string, ...) (*types.StartImpersonationResult, error)
- func (u ImpersonationUseCase) StopImpersonation(ctx context.Context, impersonatedUserID string, impersonatedSessionID string, ...) error
- type StateUseCase
- func (u StateUseCase) BanUser(ctx context.Context, userID string, request types.BanUserRequest, ...) (*types.AdminUserState, error)
- func (u StateUseCase) CreateSessionState(ctx context.Context, sessionID string, request types.CreateSessionStateRequest, ...) (*types.AdminSessionState, error)
- func (u StateUseCase) CreateUserState(ctx context.Context, userID string, request types.CreateUserStateRequest, ...) (*types.AdminUserState, error)
- func (u StateUseCase) DeleteSessionState(ctx context.Context, sessionID string) error
- func (u StateUseCase) DeleteUserState(ctx context.Context, userID string) error
- func (u StateUseCase) GetBannedUserStates(ctx context.Context) ([]types.AdminUserState, error)
- func (u StateUseCase) GetRevokedSessionStates(ctx context.Context) ([]types.AdminSessionState, error)
- func (u StateUseCase) GetSessionState(ctx context.Context, sessionID string) (*types.AdminSessionState, error)
- func (u StateUseCase) GetUserAdminSessions(ctx context.Context, userID string) ([]types.AdminUserSession, error)
- func (u StateUseCase) GetUserState(ctx context.Context, userID string) (*types.AdminUserState, error)
- func (u StateUseCase) RevokeSession(ctx context.Context, sessionID string, reason *string, actorUserID *string) (*types.AdminSessionState, error)
- func (u StateUseCase) UnbanUser(ctx context.Context, userID string) (*types.AdminUserState, error)
- func (u StateUseCase) UpdateSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, ...) (*types.AdminSessionState, error)
- func (u StateUseCase) UpdateUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, ...) (*types.AdminUserState, error)
- func (u StateUseCase) UpsertSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, ...) (*types.AdminSessionState, error)
- func (u StateUseCase) UpsertUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, ...) (*types.AdminUserState, error)
- type UsersUseCase
- func (u UsersUseCase) Create(ctx context.Context, request types.CreateUserRequest) (*models.User, error)
- func (u UsersUseCase) Delete(ctx context.Context, userID string) error
- func (u UsersUseCase) GetAll(ctx context.Context, cursor *string, limit int) (*types.UsersPage, error)
- func (u UsersUseCase) GetByID(ctx context.Context, userID string) (*models.User, error)
- func (u UsersUseCase) Update(ctx context.Context, userID string, request types.UpdateUserRequest) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountsUseCase ¶
type AccountsUseCase struct {
// contains filtered or unexported fields
}
func NewAccountsUseCase ¶
func NewAccountsUseCase(service *services.AccountsService) AccountsUseCase
func (AccountsUseCase) Create ¶
func (u AccountsUseCase) Create(ctx context.Context, userID string, request types.CreateAccountRequest) (*models.Account, error)
func (AccountsUseCase) Delete ¶
func (u AccountsUseCase) Delete(ctx context.Context, accountID string) error
func (AccountsUseCase) GetByUserID ¶
type AdminUseCases ¶
type AdminUseCases struct {
// contains filtered or unexported fields
}
func NewAdminUseCases ¶
func NewAdminUseCases( config types.AdminPluginConfig, userRepo corerepositories.UserRepository, accountRepo corerepositories.AccountRepository, sessionService rootservices.SessionService, tokenService rootservices.TokenService, passwordService rootservices.PasswordService, userStateRepo repositories.UserStateRepository, sessionStateRepo repositories.SessionStateRepository, impersonationRepo repositories.ImpersonationRepository, sessionExpiresIn time.Duration, ) *AdminUseCases
func (*AdminUseCases) AccountsUseCase ¶
func (u *AdminUseCases) AccountsUseCase() AccountsUseCase
func (*AdminUseCases) BanUser ¶
func (u *AdminUseCases) BanUser(ctx context.Context, userID string, request types.BanUserRequest, actorUserID *string) (*types.AdminUserState, error)
func (*AdminUseCases) CreateAccount ¶
func (u *AdminUseCases) CreateAccount(ctx context.Context, userID string, request types.CreateAccountRequest) (*models.Account, error)
func (*AdminUseCases) CreateSessionState ¶
func (u *AdminUseCases) CreateSessionState(ctx context.Context, sessionID string, request types.CreateSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)
func (*AdminUseCases) CreateUser ¶
func (u *AdminUseCases) CreateUser(ctx context.Context, request types.CreateUserRequest) (*models.User, error)
func (*AdminUseCases) CreateUserState ¶
func (u *AdminUseCases) CreateUserState(ctx context.Context, userID string, request types.CreateUserStateRequest, actorUserID *string) (*types.AdminUserState, error)
func (*AdminUseCases) DeleteAccount ¶
func (u *AdminUseCases) DeleteAccount(ctx context.Context, accountID string) error
func (*AdminUseCases) DeleteSessionState ¶
func (u *AdminUseCases) DeleteSessionState(ctx context.Context, sessionID string) error
func (*AdminUseCases) DeleteUser ¶
func (u *AdminUseCases) DeleteUser(ctx context.Context, userID string) error
func (*AdminUseCases) DeleteUserState ¶
func (u *AdminUseCases) DeleteUserState(ctx context.Context, userID string) error
func (*AdminUseCases) GetAccountByID ¶
func (*AdminUseCases) GetAllImpersonations ¶
func (u *AdminUseCases) GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)
func (*AdminUseCases) GetAllUsers ¶
func (*AdminUseCases) GetBannedUserStates ¶
func (u *AdminUseCases) GetBannedUserStates(ctx context.Context) ([]types.AdminUserState, error)
func (*AdminUseCases) GetImpersonationByID ¶
func (u *AdminUseCases) GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)
func (*AdminUseCases) GetRevokedSessionStates ¶
func (u *AdminUseCases) GetRevokedSessionStates(ctx context.Context) ([]types.AdminSessionState, error)
func (*AdminUseCases) GetSessionState ¶
func (u *AdminUseCases) GetSessionState(ctx context.Context, sessionID string) (*types.AdminSessionState, error)
func (*AdminUseCases) GetUserAccounts ¶
func (*AdminUseCases) GetUserAdminSessions ¶
func (u *AdminUseCases) GetUserAdminSessions(ctx context.Context, userID string) ([]types.AdminUserSession, error)
func (*AdminUseCases) GetUserByID ¶
func (*AdminUseCases) GetUserState ¶
func (u *AdminUseCases) GetUserState(ctx context.Context, userID string) (*types.AdminUserState, error)
func (*AdminUseCases) ImpersonationUseCase ¶
func (u *AdminUseCases) ImpersonationUseCase() ImpersonationUseCase
func (*AdminUseCases) RevokeSession ¶
func (u *AdminUseCases) RevokeSession(ctx context.Context, sessionID string, reason *string, actorUserID *string) (*types.AdminSessionState, error)
func (*AdminUseCases) StartImpersonation ¶
func (u *AdminUseCases) StartImpersonation(ctx context.Context, actorUserID string, actorSessionID *string, ipAddress *string, userAgent *string, req types.StartImpersonationRequest) (*types.StartImpersonationResult, error)
func (*AdminUseCases) StateUseCase ¶
func (u *AdminUseCases) StateUseCase() StateUseCase
func (*AdminUseCases) StopImpersonation ¶
func (u *AdminUseCases) StopImpersonation(ctx context.Context, impersonatedUserID string, impersonatedSessionID string, request types.StopImpersonationRequest) error
func (*AdminUseCases) UnbanUser ¶
func (u *AdminUseCases) UnbanUser(ctx context.Context, userID string) (*types.AdminUserState, error)
func (*AdminUseCases) UpdateAccount ¶
func (u *AdminUseCases) UpdateAccount(ctx context.Context, accountID string, request types.UpdateAccountRequest) (*models.Account, error)
func (*AdminUseCases) UpdateSessionState ¶
func (u *AdminUseCases) UpdateSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)
func (*AdminUseCases) UpdateUser ¶
func (u *AdminUseCases) UpdateUser(ctx context.Context, userID string, request types.UpdateUserRequest) (*models.User, error)
func (*AdminUseCases) UpdateUserState ¶
func (u *AdminUseCases) UpdateUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, actorUserID *string) (*types.AdminUserState, error)
func (*AdminUseCases) UpsertSessionState ¶
func (u *AdminUseCases) UpsertSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)
func (*AdminUseCases) UpsertUserState ¶
func (u *AdminUseCases) UpsertUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, actorUserID *string) (*types.AdminUserState, error)
func (*AdminUseCases) UsersUseCase ¶
func (u *AdminUseCases) UsersUseCase() UsersUseCase
type ImpersonationUseCase ¶
type ImpersonationUseCase struct {
// contains filtered or unexported fields
}
func NewImpersonationUseCase ¶
func NewImpersonationUseCase( stateService *services.StateService, impersonationService *services.ImpersonationService, ) ImpersonationUseCase
func (ImpersonationUseCase) GetAllImpersonations ¶
func (u ImpersonationUseCase) GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)
func (ImpersonationUseCase) GetImpersonationByID ¶
func (u ImpersonationUseCase) GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)
func (ImpersonationUseCase) StartImpersonation ¶
func (u ImpersonationUseCase) StartImpersonation(ctx context.Context, actorUserID string, actorSessionID *string, ipAddress *string, userAgent *string, req types.StartImpersonationRequest) (*types.StartImpersonationResult, error)
func (ImpersonationUseCase) StopImpersonation ¶
func (u ImpersonationUseCase) StopImpersonation(ctx context.Context, impersonatedUserID string, impersonatedSessionID string, request types.StopImpersonationRequest) error
type StateUseCase ¶
type StateUseCase struct {
// contains filtered or unexported fields
}
func NewStateUseCase ¶
func NewStateUseCase(service *services.StateService) StateUseCase
func (StateUseCase) BanUser ¶
func (u StateUseCase) BanUser(ctx context.Context, userID string, request types.BanUserRequest, actorUserID *string) (*types.AdminUserState, error)
func (StateUseCase) CreateSessionState ¶
func (u StateUseCase) CreateSessionState(ctx context.Context, sessionID string, request types.CreateSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)
func (StateUseCase) CreateUserState ¶
func (u StateUseCase) CreateUserState(ctx context.Context, userID string, request types.CreateUserStateRequest, actorUserID *string) (*types.AdminUserState, error)
func (StateUseCase) DeleteSessionState ¶
func (u StateUseCase) DeleteSessionState(ctx context.Context, sessionID string) error
func (StateUseCase) DeleteUserState ¶
func (u StateUseCase) DeleteUserState(ctx context.Context, userID string) error
func (StateUseCase) GetBannedUserStates ¶
func (u StateUseCase) GetBannedUserStates(ctx context.Context) ([]types.AdminUserState, error)
func (StateUseCase) GetRevokedSessionStates ¶
func (u StateUseCase) GetRevokedSessionStates(ctx context.Context) ([]types.AdminSessionState, error)
func (StateUseCase) GetSessionState ¶
func (u StateUseCase) GetSessionState(ctx context.Context, sessionID string) (*types.AdminSessionState, error)
func (StateUseCase) GetUserAdminSessions ¶
func (u StateUseCase) GetUserAdminSessions(ctx context.Context, userID string) ([]types.AdminUserSession, error)
func (StateUseCase) GetUserState ¶
func (u StateUseCase) GetUserState(ctx context.Context, userID string) (*types.AdminUserState, error)
func (StateUseCase) RevokeSession ¶
func (u StateUseCase) RevokeSession(ctx context.Context, sessionID string, reason *string, actorUserID *string) (*types.AdminSessionState, error)
func (StateUseCase) UnbanUser ¶
func (u StateUseCase) UnbanUser(ctx context.Context, userID string) (*types.AdminUserState, error)
func (StateUseCase) UpdateSessionState ¶
func (u StateUseCase) UpdateSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)
func (StateUseCase) UpdateUserState ¶
func (u StateUseCase) UpdateUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, actorUserID *string) (*types.AdminUserState, error)
func (StateUseCase) UpsertSessionState ¶
func (u StateUseCase) UpsertSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)
func (StateUseCase) UpsertUserState ¶
func (u StateUseCase) UpsertUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, actorUserID *string) (*types.AdminUserState, error)
type UsersUseCase ¶
type UsersUseCase struct {
// contains filtered or unexported fields
}
func NewUsersUseCase ¶
func NewUsersUseCase(service *services.UsersService) UsersUseCase
func (UsersUseCase) Create ¶
func (u UsersUseCase) Create(ctx context.Context, request types.CreateUserRequest) (*models.User, error)
Click to show internal directories.
Click to hide internal directories.