-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathservice.go
More file actions
34 lines (30 loc) · 807 Bytes
/
service.go
File metadata and controls
34 lines (30 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import "github.com/microlib/usermanager/lib"
type UserManagerServiceInterface interface {
FindUser(string) (usermanager.UserInterface, error)
}
type UserManagerService struct{}
func (u *UserManagerService) FindUser(id string) (usermanager.UserInterface, error) {
users := usermanager.NewUsers([]map[string]string{
map[string]string{
"id": "1",
"name": "Padraig",
"email": "padraig@irish.ie",
"password": "123abc",
},
map[string]string{
"id": "2",
"name": "Padraig",
"email": "pat@superirish.com",
"password": "mypassword123!",
},
map[string]string{
"id": "3",
"name": "Roberto",
"email": "robbie@italianovero.it",
"password": "passwordsupersicura",
},
})
res, err := users.Get(id)
return res, err
}