Documentation
¶
Index ¶
- type ConnectionHealth
- type CreateDeviceParams
- type CreatePermissionParams
- type CreateSessionParams
- type CreateUserActionParams
- type CreateUserDeviceParams
- type CreateUserParams
- type CreateUserPermissionParams
- type CreateUserPreferencesParams
- type CreateUserProfileParams
- type CreateUserStateParams
- type CreateUserVerificationParams
- type DatabaseHealth
- type DeleteUserPermissionParams
- type DeviceStore
- type DivaAction
- type DivaActionVerification
- type DivaDevice
- type DivaPermission
- type DivaSession
- type DivaUser
- type DivaUserDevice
- type DivaUserPermission
- type DivaUserPreference
- type DivaUserProfile
- type DivaUserState
- type GetUserActionByUserAndNameParams
- type GetUserPermissionByNameParams
- type GetUserPermissionParams
- type HealthResult
- type ListPermissionsParams
- type ListUsersParams
- type MediaType
- type PermissionStore
- type RoleType
- type SessionStatusType
- type SessionStore
- type SessionType
- type Storage
- type ThemeType
- type UpdateEmailParams
- type UpdatePasswordParams
- type UpdatePermissionActionParams
- type UpdatePermissionParams
- type UpdatePermissionRoleLevelParams
- type UpdatePhoneNumberParams
- type UpdateRoleParams
- type UpdateSessionParams
- type UpdateSessionStatusParams
- type UpdateUserPermissionParams
- type UpdateUserPreferencesParams
- type UpdateUserProfileAvatarParams
- type UpdateUserProfileParams
- type UpdateUserStatusParams
- type UpdateUserVerificationParams
- type UpdateUserVerifiedParams
- type UpdateUsernameParams
- type UserActionStore
- type UserPermissionStore
- type UserPreferenceStore
- type UserProfileStore
- type UserStateStore
- type UserStatusType
- type UserStore
- type UserVerificationStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionHealth ¶
type CreateDeviceParams ¶
type CreatePermissionParams ¶
type CreateSessionParams ¶
type CreateUserActionParams ¶
type CreateUserDeviceParams ¶
type CreateUserParams ¶
type CreateUserProfileParams ¶
type CreateUserStateParams ¶
type CreateUserStateParams struct {
UserID uuid.UUID
Verified bool
Status UserStatusType
}
type DatabaseHealth ¶
type DeviceStore ¶
type DeviceStore interface {
CreateDevice(ctx context.Context, arg *CreateDeviceParams) error
GetDeviceByName(ctx context.Context, name string) (*DivaDevice, error)
GetDeviceByID(ctx context.Context, id uuid.UUID) (*DivaDevice, error)
ListAllDevices(ctx context.Context) ([]DivaDevice, error)
CreateUserDevice(ctx context.Context, arg *CreateUserDeviceParams) error
GetUserDevice(ctx context.Context, userID uuid.UUID, deviceID uuid.UUID) (*DivaUserDevice, error)
ListUserDevices(ctx context.Context, userID uuid.UUID) ([]DivaUserDevice, error)
DeleteUserDevice(ctx context.Context, userID uuid.UUID, deviceID uuid.UUID) error
}
type DivaActionVerification ¶
type DivaDevice ¶
type DivaPermission ¶
type DivaSession ¶
type DivaUserDevice ¶
type DivaUserPermission ¶
type DivaUserPreference ¶
type DivaUserProfile ¶
type DivaUserState ¶
type GetUserPermissionParams ¶
type HealthResult ¶
type HealthResult struct {
Status string `json:"status"`
Message string `json:"message"`
Timestamp time.Time `json:"timestamp"`
ResponseTime time.Duration `json:"response_time"`
Database DatabaseHealth `json:"database"`
Connection ConnectionHealth `json:"connection"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type ListPermissionsParams ¶
type ListUsersParams ¶
type PermissionStore ¶
type PermissionStore interface {
CreatePermission(ctx context.Context, arg *CreatePermissionParams) error
GetPermissionByID(ctx context.Context, id uuid.UUID) (*DivaPermission, error)
GetPermissionByName(ctx context.Context, action string) (*DivaPermission, error)
ListPermissions(ctx context.Context, arg *ListPermissionsParams) ([]DivaPermission, error)
CountPermissions(ctx context.Context) (int64, error)
UpdatePermission(ctx context.Context, arg *UpdatePermissionParams) error
UpdatePermissionAction(ctx context.Context, arg *UpdatePermissionActionParams) error
UpdatePermissionRoleLevel(ctx context.Context, arg *UpdatePermissionRoleLevelParams) error
DeletePermission(ctx context.Context, id uuid.UUID) error
SoftDeletePermission(ctx context.Context, id uuid.UUID) error
RestorePermission(ctx context.Context, id uuid.UUID) error
}
type SessionStatusType ¶
type SessionStatusType string
const ( SessionStatusTypeACTIVE SessionStatusType = "ACTIVE" SessionStatusTypeEXPIRED SessionStatusType = "EXPIRED" SessionStatusTypeCLOSED SessionStatusType = "CLOSED" )
type SessionStore ¶
type SessionStore interface {
CreateSession(ctx context.Context, arg *CreateSessionParams) error
ListSessions(ctx context.Context) ([]DivaSession, error)
GetSessionByID(ctx context.Context, id uuid.UUID) (*DivaSession, error)
UpdateSession(ctx context.Context, arg *UpdateSessionParams) error
UpdateSessionStatus(ctx context.Context, arg *UpdateSessionStatusParams) error
CloseExpiredSessions(ctx context.Context) error
SoftDeleteSession(ctx context.Context, id uuid.UUID) error
// deletes soft deleted
DeleteSessionsForever(ctx context.Context) error
ListSessionsByUser(ctx context.Context, userID uuid.UUID) ([]DivaSession, error)
CloseAllByUser(ctx context.Context, userID uuid.UUID) error
}
type SessionType ¶
type SessionType string
const ( SessionTypeNORMAL SessionType = "NORMAL" SessionTypeTEMPORAL SessionType = "TEMPORAL" )
type Storage ¶
type Storage interface {
Close() error
Health(ctx context.Context) HealthResult
UserStore() UserStore
PermissionStore() PermissionStore
DeviceStore() DeviceStore
SessionStore() SessionStore
UserStateStore() UserStateStore
UserProfileStore() UserProfileStore
UserPreferenceStore() UserPreferenceStore
UserPermissionStore() UserPermissionStore
UserActionStore() UserActionStore
UserVerificationStore() UserVerificationStore
}
type UpdateEmailParams ¶
type UpdatePasswordParams ¶
type UpdatePermissionParams ¶
type UpdatePhoneNumberParams ¶
type UpdateRoleParams ¶
type UpdateSessionParams ¶
type UpdateSessionStatusParams ¶
type UpdateSessionStatusParams struct {
Status SessionStatusType
ID uuid.UUID
}
type UpdateUserProfileParams ¶
type UpdateUserStatusParams ¶
type UpdateUserStatusParams struct {
Status UserStatusType
UserID uuid.UUID
}
type UpdateUsernameParams ¶
type UserActionStore ¶
type UserActionStore interface {
CreateUserAction(ctx context.Context, arg *CreateUserActionParams) error
GetUserActionByID(ctx context.Context, id uuid.UUID) (*DivaAction, error)
GetUserActionByUserAndName(ctx context.Context, arg *GetUserActionByUserAndNameParams) (*DivaAction, error)
ListActionsByUser(ctx context.Context, userID uuid.UUID) ([]DivaAction, error)
DeleteUserAction(ctx context.Context, id uuid.UUID) error
DeleteUserActionByUser(ctx context.Context, userID uuid.UUID) error
DeleteExpiredActions(ctx context.Context) error
}
type UserPermissionStore ¶
type UserPermissionStore interface {
CreateUserPermission(ctx context.Context, arg *CreateUserPermissionParams) error
GetUserPermission(ctx context.Context, arg *GetUserPermissionParams) (*DivaUserPermission, error)
GetUserPermissionByName(ctx context.Context, arg *GetUserPermissionByNameParams) (*DivaUserPermission, error)
GetUserPermissions(ctx context.Context, userID uuid.UUID) ([]DivaUserPermission, error)
UpdateUserPermission(ctx context.Context, arg *UpdateUserPermissionParams) error
DeleteUserPermission(ctx context.Context, arg *DeleteUserPermissionParams) error
DeleteExpiredUserPermissions(ctx context.Context) error
}
type UserPreferenceStore ¶
type UserPreferenceStore interface {
CreateUserPreferences(ctx context.Context, arg *CreateUserPreferencesParams) error
GetPreferencesByID(ctx context.Context, id uuid.UUID) (*DivaUserPreference, error)
GetPreferencesByUser(ctx context.Context, userID uuid.UUID) ([]DivaUserPreference, error)
UpdateUserPreferences(ctx context.Context, arg *UpdateUserPreferencesParams) error
}
type UserProfileStore ¶
type UserProfileStore interface {
CreateUserProfile(ctx context.Context, arg *CreateUserProfileParams) error
GetUserProfileByUserID(ctx context.Context, userID uuid.UUID) (*DivaUserProfile, error)
UpdateUserProfile(ctx context.Context, arg *UpdateUserProfileParams) error
UpdateUserProfileAvatar(ctx context.Context, arg *UpdateUserProfileAvatarParams) error
}
type UserStateStore ¶
type UserStateStore interface {
CreateUserState(ctx context.Context, arg *CreateUserStateParams) error
GetUserStateByUserID(ctx context.Context, userID uuid.UUID) (*DivaUserState, error)
UpdateLastActiveAt(ctx context.Context, userID uuid.UUID) error
UpdateUserStatus(ctx context.Context, arg *UpdateUserStatusParams) error
UpdateUserVerified(ctx context.Context, arg *UpdateUserVerifiedParams) error
}
type UserStatusType ¶
type UserStatusType string
const ( UserStatusTypeACTIVE UserStatusType = "ACTIVE" UserStatusTypeSUSPENDED UserStatusType = "SUSPENDED" UserStatusTypeINACTIVE UserStatusType = "INACTIVE" )
type UserStore ¶
type UserStore interface {
CreateUser(ctx context.Context, arg *CreateUserParams) error
GetUserByID(ctx context.Context, id uuid.UUID) (*DivaUser, error)
GetUserByEmail(ctx context.Context, email string) (*DivaUser, error)
GetUserByUsername(ctx context.Context, username string) (*DivaUser, error)
GetUserByUsernameOrEmail(ctx context.Context, identifier string) (*DivaUser, error)
ListUsers(ctx context.Context, arg *ListUsersParams) ([]DivaUser, error)
CountUsers(ctx context.Context) (int64, error)
UpdateUsername(ctx context.Context, arg *UpdateUsernameParams) error
UpdateEmail(ctx context.Context, arg *UpdateEmailParams) error
UpdatePassword(ctx context.Context, arg *UpdatePasswordParams) error
UpdatePhoneNumber(ctx context.Context, arg *UpdatePhoneNumberParams) error
UpdateRole(ctx context.Context, arg *UpdateRoleParams) error
DeleteUser(ctx context.Context, id uuid.UUID) error
SoftDeleteUser(ctx context.Context, id uuid.UUID) error
RestoreUser(ctx context.Context, id uuid.UUID) error
}
type UserVerificationStore ¶
type UserVerificationStore interface {
CreateUserVerification(ctx context.Context, arg *CreateUserVerificationParams) error
GetUserVerification(ctx context.Context, actionID uuid.UUID) (*DivaActionVerification, error)
UpdateUserVerification(ctx context.Context, arg *UpdateUserVerificationParams) error
DeleteUserVerification(ctx context.Context, actionID uuid.UUID) error
}
Click to show internal directories.
Click to hide internal directories.