Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Game Server Go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Akamu
Game Server Go
Commits
4f93c356
Commit
4f93c356
authored
Dec 30, 2020
by
MaxGranzow
Committed by
Julien Schröter
Jan 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mock implementation of user recommendation endpoint for testing
parent
848d2ac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
test/user_test.go
test/user_test.go
+10
-0
No files found.
test/user_test.go
View file @
4f93c356
...
...
@@ -150,6 +150,16 @@ func (mockUser) SelectByUsernameLike(username string) ([]schemas.InfoUserSchema,
return
users
,
nil
}
func
(
mockUser
)
SelectUserRecommendations
(
userID
uint32
,
count
uint32
)
([]
schemas
.
InfoUserSchema
,
error
)
{
var
users
[]
schemas
.
InfoUserSchema
for
_
,
u
:=
range
mockUsers
{
if
u
.
ID
!=
userID
{
users
=
append
(
users
,
getMockUserInfo
(
u
))
}
}
return
users
,
nil
}
// Users with IDs 1-3 have authentication. Everyone else will be rejected.
func
(
mockUser
)
Authenticate
(
name
string
,
password
string
)
(
uint32
,
error
)
{
if
correctpassword
,
ok
:=
mockUserPasswords
[
name
];
ok
&&
password
==
correctpassword
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment