Documentation ¶
Index ¶
- type ACLRepository
- type ACLService
- type AuthCache
- type AuthService
- type AuthUnitOfWork
- type Driver
- type EmailSender
- type Event
- type OTPCache
- type OTPCacheService
- type PermissionRepository
- type PermissionService
- type RoleCache
- type RoleCacheService
- type RoleRepository
- type RoleService
- type TOTPCache
- type TOTPService
- type UnitOfWork
- type UserClient
- type UserRepository
- type UserService
- type UserUnitOfWork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACLRepository ¶
type ACLService ¶
type ACLService interface { CheckAccess( ctx context.Context, uow AuthUnitOfWork, userUUID uuid.UUID, requiredPermissions ...domain.PermissionKeyType, ) (bool, uint64, error) AssignUserRoleToUser(uow AuthUnitOfWork, userID uint64) error }
type AuthService ¶
type AuthUnitOfWork ¶
type AuthUnitOfWork interface { UnitOfWork RoleRepository() RoleRepository PermissionRepository() PermissionRepository ACLRepository() ACLRepository }
type EmailSender ¶
type OTPCacheService ¶
type OTPCacheService interface { Set(ctx context.Context, key string, otp string) error Validate(ctx context.Context, key string, otp string) error Used(ctx context.Context, key string) error SetForgetPassword(ctx context.Context, key string, otp string) error ValidateForgetPassword(ctx context.Context, key string, otp string) error UsedForgetPassword(ctx context.Context, key string) error }
type PermissionRepository ¶
type PermissionService ¶
type PermissionService interface {
List(uow AuthUnitOfWork) ([]*domain.Permission, error)
}
type RoleCacheService ¶
type RoleRepository ¶
type RoleRepository interface { Create(role domain.Role) error GetByUUID(uuid uuid.UUID) (*domain.Role, error) List() ([]*domain.Role, error) Update(role domain.Role, uuid uuid.UUID) error Delete(uuid uuid.UUID, deletedBy uint64) error ExistKey(key domain.RoleKeyType) (bool, error) GetRoleUser() (domain.Role, error) GetPermissions(uuid uuid.UUID) (*domain.Role, error) SyncPermissions(roleID uint64, permissionIDs []uint64) error GetUserRoleKeys(userID uint64) ([]domain.RoleKeyType, error) }
type RoleService ¶
type RoleService interface { Create(uow AuthUnitOfWork, role domain.Role) error Get(uow AuthUnitOfWork, uuidStr string) (*domain.Role, error) List(ctx context.Context, uow AuthUnitOfWork) ([]*domain.Role, error) Update(ctx context.Context, uow AuthUnitOfWork, role domain.Role, uuidStr string) error Delete(uow AuthUnitOfWork, uuidStr string, deletedBy uint64) error GetPermissions(uow AuthUnitOfWork, uuidStr string) (*domain.Role, error) SyncPermissions(uow AuthUnitOfWork, uuidStr string, permissionUUIDStr []string) error }
type TOTPService ¶
type TOTPService interface { Enroll(ctx context.Context, email string) (*domain.TOTPKey, error) Enable(ctx context.Context, uow UserUnitOfWork, userID uint64, email string, code string) error Disable(ctx context.Context, uow UserUnitOfWork, userID uint64, code string) error Get(ctx context.Context, uow UserUnitOfWork, userID uint64, email string) (*domain.TOTPKey, error) Verify(passCode string, secret string) (bool, error) }
type UnitOfWork ¶
type UserClient ¶
type UserClient interface { IsEmailUnique(ctx context.Context, email string) error Create(ctx context.Context, user domain.User) (*domain.User, error) GetByEmail(ctx context.Context, email string) (*domain.User, error) GetByUUID(ctx context.Context, uuidStr string) (*domain.User, error) VerifiedEmail(ctx context.Context, email string) error MarkWelcomeMessageSent(ctx context.Context, ID uint64) error UpdateGoogleID(ctx context.Context, ID uint64, googleID string) error UpdateLastLoginTime(ctx context.Context, ID uint64) error UpdatePassword(ctx context.Context, ID uint64, password string) error }
type UserRepository ¶
type UserRepository interface { GetByUUID(uuid uuid.UUID) (*domain.User, error) GetByID(id uint64) (*domain.User, error) IsEmailUnique(email string) (bool, error) GetByEmail(email string) (*domain.User, error) List() ([]*domain.User, error) Save(user *domain.User) (*domain.User, error) VerifiedEmail(email string) error MarkWelcomeMessageSent(id uint64) error UpdateGoogleID(id uint64, googleID string) error UpdateLastLoginTime(id uint64) error UpdatePassword(id uint64, password string) error UpdateTOTPSecret(id uint64, secret *string) error GetTOTPSecret(id uint64) (*string, error) }
UserRepository is an interface for interacting with user-related data
type UserService ¶
type UserService interface { GetByUUID(uow UserUnitOfWork, uuidStr string) (*domain.User, error) GetByID(uow UserUnitOfWork, id uint64) (*domain.User, error) IsEmailUnique(uow UserUnitOfWork, email string) error GetByEmail(uow UserUnitOfWork, email string) (*domain.User, error) List(uow UserUnitOfWork) ([]*domain.User, error) Create(uow UserUnitOfWork, user domain.User) (*domain.User, error) VerifiedEmail(uow UserUnitOfWork, email string) error MarkWelcomeMessageSent(uow UserUnitOfWork, id uint64) error UpdateGoogleID(uow UserUnitOfWork, id uint64, googleID string) error UpdateLastLoginTime(uow UserUnitOfWork, id uint64) error UpdatePassword(uow UserUnitOfWork, id uint64, password string) error }
UserService is an interface for interacting with user-related business logic
type UserUnitOfWork ¶
type UserUnitOfWork interface { UnitOfWork UserRepository() UserRepository }
Click to show internal directories.
Click to hide internal directories.