forked from sensu/sensu-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
users.go
53 lines (44 loc) · 1.24 KB
/
users.go
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package mockstore
import (
"context"
"github.com/sensu/sensu-go/backend/store"
"github.com/sensu/sensu-go/types"
)
// AuthenticateUser ...
func (s *MockStore) AuthenticateUser(
ctx context.Context,
username, password string,
) (*types.User, error) {
args := s.Called(ctx, username, password)
return args.Get(0).(*types.User), args.Error(1)
}
// CreateUser ...
func (s *MockStore) CreateUser(user *types.User) error {
args := s.Called(user)
return args.Error(0)
}
// DeleteUser ...
func (s *MockStore) DeleteUser(ctx context.Context, user *types.User) error {
args := s.Called(ctx, user)
return args.Error(0)
}
// GetUser ...
func (s *MockStore) GetUser(ctx context.Context, username string) (*types.User, error) {
args := s.Called(ctx, username)
return args.Get(0).(*types.User), args.Error(1)
}
// GetUsers ...
func (s *MockStore) GetUsers() ([]*types.User, error) {
args := s.Called()
return args.Get(0).([]*types.User), args.Error(1)
}
// GetAllUsers ...
func (s *MockStore) GetAllUsers(pred *store.SelectionPredicate) ([]*types.User, error) {
args := s.Called(pred)
return args.Get(0).([]*types.User), args.Error(1)
}
// UpdateUser ...
func (s *MockStore) UpdateUser(user *types.User) error {
args := s.Called(user)
return args.Error(0)
}