services

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsService

type AccountsService struct {
	// contains filtered or unexported fields
}

func (*AccountsService) Create

func (s *AccountsService) Create(ctx context.Context, userID string, request types.CreateAccountRequest) (*models.Account, error)

func (*AccountsService) Delete

func (s *AccountsService) Delete(ctx context.Context, accountID string) error

func (*AccountsService) GetByID

func (s *AccountsService) GetByID(ctx context.Context, accountID string) (*models.Account, error)

func (*AccountsService) GetByUserID

func (s *AccountsService) GetByUserID(ctx context.Context, userID string) ([]models.Account, error)

func (*AccountsService) Update

func (s *AccountsService) Update(ctx context.Context, accountID string, request types.UpdateAccountRequest) (*models.Account, error)

type ImpersonationService

type ImpersonationService struct {
	// contains filtered or unexported fields
}

func NewImpersonationService

func NewImpersonationService(
	impersonationRepo repositories.ImpersonationRepository,
	sessionStateRepo repositories.SessionStateRepository,
	sessionService rootservices.SessionService,
	tokenService rootservices.TokenService,
	sessionExpiresIn time.Duration,
	maxExpiresIn time.Duration,
) *ImpersonationService

func (*ImpersonationService) GetAllImpersonations

func (s *ImpersonationService) GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)

func (*ImpersonationService) GetImpersonationByID

func (s *ImpersonationService) GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)

func (*ImpersonationService) StartImpersonation

func (s *ImpersonationService) StartImpersonation(
	ctx context.Context,
	actorUserID string,
	actorSessionID *string,
	ipAddress *string,
	userAgent *string,
	req types.StartImpersonationRequest,
) (*types.StartImpersonationResult, error)

func (*ImpersonationService) StopImpersonation

func (s *ImpersonationService) StopImpersonation(ctx context.Context, actorUserID string, request types.StopImpersonationRequest) error

type StateService

type StateService struct {
	// contains filtered or unexported fields
}

func NewStateService

func NewStateService(userStateRepo repositories.UserStateRepository, sessionStateRepo repositories.SessionStateRepository, impersonationRepo repositories.ImpersonationRepository) *StateService

func (*StateService) BanUser

func (s *StateService) BanUser(ctx context.Context, userID string, request types.BanUserRequest, actorUserID *string) (*types.AdminUserState, error)

func (*StateService) CreateSessionState

func (s *StateService) CreateSessionState(ctx context.Context, sessionID string, request types.CreateSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)

func (*StateService) CreateUserState

func (s *StateService) CreateUserState(ctx context.Context, userID string, request types.CreateUserStateRequest, actorUserID *string) (*types.AdminUserState, error)

func (*StateService) DeleteSessionState

func (s *StateService) DeleteSessionState(ctx context.Context, sessionID string) error

func (*StateService) DeleteUserState

func (s *StateService) DeleteUserState(ctx context.Context, userID string) error

func (*StateService) GetBannedUserStates

func (s *StateService) GetBannedUserStates(ctx context.Context) ([]types.AdminUserState, error)

func (*StateService) GetRevokedSessionStates

func (s *StateService) GetRevokedSessionStates(ctx context.Context) ([]types.AdminSessionState, error)

func (*StateService) GetSessionState

func (s *StateService) GetSessionState(ctx context.Context, sessionID string) (*types.AdminSessionState, error)

func (*StateService) GetUserAdminSessions

func (s *StateService) GetUserAdminSessions(ctx context.Context, userID string) ([]types.AdminUserSession, error)

func (*StateService) GetUserState

func (s *StateService) GetUserState(ctx context.Context, userID string) (*types.AdminUserState, error)

func (*StateService) RevokeSession

func (s *StateService) RevokeSession(ctx context.Context, sessionID string, reason *string, actorUserID *string) (*types.AdminSessionState, error)

func (*StateService) UnbanUser

func (s *StateService) UnbanUser(ctx context.Context, userID string) (*types.AdminUserState, error)

func (*StateService) UpdateSessionState

func (s *StateService) UpdateSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)

func (*StateService) UpdateUserState

func (s *StateService) UpdateUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, actorUserID *string) (*types.AdminUserState, error)

func (*StateService) UpsertSessionState

func (s *StateService) UpsertSessionState(ctx context.Context, sessionID string, request types.UpsertSessionStateRequest, actorUserID *string) (*types.AdminSessionState, error)

func (*StateService) UpsertUserState

func (s *StateService) UpsertUserState(ctx context.Context, userID string, request types.UpsertUserStateRequest, actorUserID *string) (*types.AdminUserState, error)

type UsersService

type UsersService struct {
	// contains filtered or unexported fields
}

func NewUsersService

func NewUsersService(userRepo repositories.UserRepository) *UsersService

func (*UsersService) Create

func (s *UsersService) Create(ctx context.Context, request types.CreateUserRequest) (*models.User, error)

func (*UsersService) Delete

func (s *UsersService) Delete(ctx context.Context, userID string) error

func (*UsersService) GetAll

func (s *UsersService) GetAll(ctx context.Context, cursor *string, limit int) (*types.UsersPage, error)

func (*UsersService) GetByID

func (s *UsersService) GetByID(ctx context.Context, userID string) (*models.User, error)

func (*UsersService) Update

func (s *UsersService) Update(ctx context.Context, userID string, request types.UpdateUserRequest) (*models.User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL