Documentation
¶
Index ¶
- func NewUserRepo(db *db.Client, ipdb *ipdb.IPDB, redis *redis.Client, cfg *config.Config) domain.UserRepo
- type UserRepo
- func (r *UserRepo) AdminByName(ctx context.Context, username string) (*db.Admin, error)
- func (r *UserRepo) AdminList(ctx context.Context, page *web.Pagination) ([]*db.Admin, *db.PageInfo, error)
- func (r *UserRepo) AdminLoginHistory(ctx context.Context, page *web.Pagination) ([]*db.AdminLoginHistory, *db.PageInfo, error)
- func (r *UserRepo) CleanPermissionCache(ctx context.Context, id uuid.UUID)
- func (r *UserRepo) CreateAdmin(ctx context.Context, admin *db.Admin, roleID int64) (*db.Admin, error)
- func (r *UserRepo) CreateInviteCode(ctx context.Context, userID string, code string) (*db.InviteCode, error)
- func (r *UserRepo) CreateUser(ctx context.Context, us *db.User) (*db.User, error)
- func (r *UserRepo) Delete(ctx context.Context, id string) error
- func (r *UserRepo) DeleteAdmin(ctx context.Context, id string) error
- func (r *UserRepo) ExportCompletionData(ctx context.Context) ([]*domain.CompletionData, error)
- func (r *UserRepo) GetByName(ctx context.Context, username string) (*db.User, error)
- func (r *UserRepo) GetOrCreateApiKey(ctx context.Context, userID string) (*db.ApiKey, error)
- func (r *UserRepo) GetPermissions(ctx context.Context, id uuid.UUID) (*domain.Permissions, error)
- func (r *UserRepo) GetSetting(ctx context.Context) (*db.Setting, error)
- func (r *UserRepo) GetUserByApiKey(ctx context.Context, apiKey string) (*db.User, error)
- func (r *UserRepo) GetUserCount(ctx context.Context) (int64, error)
- func (r *UserRepo) GrantRole(ctx context.Context, req *domain.GrantRoleReq) error
- func (r *UserRepo) InitAdmin(ctx context.Context, username, password string) error
- func (r *UserRepo) List(ctx context.Context, page *web.Pagination) ([]*db.User, *db.PageInfo, error)
- func (r *UserRepo) ListRole(ctx context.Context) ([]*db.Role, error)
- func (r *UserRepo) OAuthLogin(ctx context.Context, platform consts.UserPlatform, req *domain.OAuthUserInfo) (*db.User, error)
- func (r *UserRepo) OAuthRegister(ctx context.Context, platform consts.UserPlatform, inviteCode string, ...) (*db.User, error)
- func (r *UserRepo) SaveAdminLoginHistory(ctx context.Context, adminID string, ip string) error
- func (r *UserRepo) SaveUserLoginHistory(ctx context.Context, userID string, ip string, session *domain.VSCodeSession) error
- func (r *UserRepo) SignUpOrIn(ctx context.Context, platform consts.UserPlatform, req *domain.OAuthUserInfo) (*db.User, error)
- func (r *UserRepo) Update(ctx context.Context, id string, ...) (*db.User, error)
- func (r *UserRepo) UpdateSetting(ctx context.Context, fn func(*db.Setting, *db.SettingUpdateOne)) (*db.Setting, error)
- func (r *UserRepo) UserLoginHistory(ctx context.Context, page *web.Pagination) ([]*db.UserLoginHistory, *db.PageInfo, error)
- func (r *UserRepo) ValidateInviteCode(ctx context.Context, code string) (*db.InviteCode, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func (*UserRepo) AdminByName ¶
func (*UserRepo) AdminLoginHistory ¶
func (r *UserRepo) AdminLoginHistory(ctx context.Context, page *web.Pagination) ([]*db.AdminLoginHistory, *db.PageInfo, error)
func (*UserRepo) CleanPermissionCache ¶
func (*UserRepo) CreateAdmin ¶
func (*UserRepo) CreateInviteCode ¶
func (*UserRepo) CreateUser ¶
func (*UserRepo) ExportCompletionData ¶
func (*UserRepo) GetOrCreateApiKey ¶
func (*UserRepo) GetPermissions ¶
func (*UserRepo) GetSetting ¶
func (*UserRepo) GetUserByApiKey ¶
GetUserByApiKey a new method to get user by api key
func (*UserRepo) OAuthLogin ¶
func (r *UserRepo) OAuthLogin(ctx context.Context, platform consts.UserPlatform, req *domain.OAuthUserInfo) (*db.User, error)
func (*UserRepo) OAuthRegister ¶
func (*UserRepo) SaveAdminLoginHistory ¶
func (*UserRepo) SaveUserLoginHistory ¶
func (*UserRepo) SignUpOrIn ¶
func (r *UserRepo) SignUpOrIn(ctx context.Context, platform consts.UserPlatform, req *domain.OAuthUserInfo) (*db.User, error)
func (*UserRepo) UpdateSetting ¶
func (*UserRepo) UserLoginHistory ¶
func (r *UserRepo) UserLoginHistory(ctx context.Context, page *web.Pagination) ([]*db.UserLoginHistory, *db.PageInfo, error)
func (*UserRepo) ValidateInviteCode ¶
Click to show internal directories.
Click to hide internal directories.