forked from sensu/sensu-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clusterrolebinding.go
49 lines (40 loc) · 1.52 KB
/
clusterrolebinding.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
package mockstore
import (
"context"
"github.com/sensu/sensu-go/backend/store"
"github.com/sensu/sensu-go/types"
)
// CreateClusterRoleBinding ...
func (s *MockStore) CreateClusterRoleBinding(ctx context.Context, ClusterRoleBinding *types.ClusterRoleBinding) error {
args := s.Called(ctx, ClusterRoleBinding)
return args.Error(0)
}
// CreateOrUpdateClusterRoleBinding ...
func (s *MockStore) CreateOrUpdateClusterRoleBinding(ctx context.Context, ClusterRoleBinding *types.ClusterRoleBinding) error {
args := s.Called(ctx, ClusterRoleBinding)
return args.Error(0)
}
// DeleteClusterRoleBinding ...
func (s *MockStore) DeleteClusterRoleBinding(ctx context.Context, name string) error {
args := s.Called(ctx, name)
return args.Error(0)
}
// GetClusterRoleBinding ...
func (s *MockStore) GetClusterRoleBinding(ctx context.Context, name string) (*types.ClusterRoleBinding, error) {
args := s.Called(ctx, name)
err := args.Error(1)
if clusterRoleBinding, ok := args.Get(0).(*types.ClusterRoleBinding); ok {
return clusterRoleBinding, err
}
return nil, err
}
// ListClusterRoleBindings ...
func (s *MockStore) ListClusterRoleBindings(ctx context.Context, pred *store.SelectionPredicate) ([]*types.ClusterRoleBinding, error) {
args := s.Called(ctx, pred)
return args.Get(0).([]*types.ClusterRoleBinding), args.Error(1)
}
// UpdateClusterRoleBinding ...
func (s *MockStore) UpdateClusterRoleBinding(ctx context.Context, clusterRoleBinding *types.ClusterRoleBinding) error {
args := s.Called(ctx, clusterRoleBinding)
return args.Error(0)
}