Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionsRepo ¶
type SessionsRepo interface { NewSession(ctx context.Context, uID uuid.UUID, deviceInf string) (sToken string, err error) KillSession(ctx context.Context, sID uuid.UUID) error KillAllSessions(ctx context.Context, uID uuid.UUID) (removedItems int, err error) GetAllSessions(ctx context.Context, uID uuid.UUID) ([]entities.Session, error) GetUserIdByToken(ctx context.Context, sToken string) (uID uuid.UUID, err error) GetSessionIdByToken(ctx context.Context, sToken string) (ID uuid.UUID, err error) GetSIdAndUIdByToken(ctx context.Context, sToken string) (sID uuid.UUID, uID uuid.UUID, err error) GetSessionInfoByToken(ctx context.Context, sToken string) (entities.Session, error) GetSessionInfoByID(ctx context.Context, sID uuid.UUID) (entities.Session, error) }
func NewSessionsRepo ¶
func NewSessionsRepo(client *redis.Client) SessionsRepo
The default interface implementation
type UsersRepo ¶
type UsersRepo interface { SaveUser(context.Context, entities.UserCreationOpts) (uID uuid.UUID, err error) RemoveUser(ctx context.Context, uID uuid.UUID) error GetUserByID(ctx context.Context, uID uuid.UUID) (entities.User, error) GetUserIdByLogin(ctx context.Context, login string) (uID uuid.UUID, err error) VerifyLoginCreds(context.Context, entities.Creds) (uID uuid.UUID, valid bool, err error) VerifyIdAndPassword(ctx context.Context, uid uuid.UUID, password string) (valid bool, err error) IsLoginTaken(ctx context.Context, login string) (isFree bool, err error) GetCountOfUsers(ctx context.Context) (count int, err error) // Change the user ChangeLogin(ctx context.Context, uID uuid.UUID, newLogin string) error ChangePassword(ctx context.Context, uID uuid.UUID, newPassword string) error ChangeDisplayedName(ctx context.Context, uID uuid.UUID, newName string) error // Manipulations with the admin table: MakeAdmin(ctx context.Context, uID uuid.UUID) error IsAdmin(ctx context.Context, uID uuid.UUID) (admin bool, err error) GetAllAdmins(ctx context.Context) (admins []entities.UserWithoutLogin, err error) // Actions to ban or unban someone BanUser(ctx context.Context, bannedID uuid.UUID, bannedByID uuid.UUID) error UnbanUser(ctx context.Context, bannedID uuid.UUID, bannedByID uuid.UUID) error IsBanned(ctx context.Context, bannedID uuid.UUID, bannedByID uuid.UUID) (bool, error) // Username actions GetFreeUsernameId(ctx context.Context, username string) (id int, err error) SetUsername(ctx context.Context, uID uuid.UUID, username string) error SetNilUsername(ctx context.Context, uID uuid.UUID) error GetUsernameByID(ctx context.Context, uID uuid.UUID) (username.Username, error) GetIdByUsername(ctx context.Context, username username.Username) (uid uuid.UUID, err error) }
func NewUsersRepo ¶
Click to show internal directories.
Click to hide internal directories.