/
broken_store.go
89 lines (70 loc) · 2.1 KB
/
broken_store.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package testfakes
import (
"errors"
"github.com/coreos/matchbox/matchbox/storage/storagepb"
)
var (
errIntentional = errors.New("store: error for testing purposes")
)
// BrokenStore returns errors for testing purposes.
type BrokenStore struct{}
// GroupPut returns an error.
func (s *BrokenStore) GroupPut(group *storagepb.Group) error {
return errIntentional
}
// GroupGet returns an error.
func (s *BrokenStore) GroupGet(id string) (*storagepb.Group, error) {
return nil, errIntentional
}
// GroupDelete returns an error.
func (s *BrokenStore) GroupDelete(id string) error {
return errIntentional
}
// GroupList returns an error.
func (s *BrokenStore) GroupList() (groups []*storagepb.Group, err error) {
return groups, errIntentional
}
// ProfilePut returns an error.
func (s *BrokenStore) ProfilePut(profile *storagepb.Profile) error {
return errIntentional
}
// ProfileGet returns an error.
func (s *BrokenStore) ProfileGet(id string) (*storagepb.Profile, error) {
return nil, errIntentional
}
// ProfileDelete returns an error.
func (s *BrokenStore) ProfileDelete(id string) error {
return errIntentional
}
// ProfileList returns an error.
func (s *BrokenStore) ProfileList() (profiles []*storagepb.Profile, err error) {
return profiles, errIntentional
}
// IgnitionPut returns an error.
func (s *BrokenStore) IgnitionPut(name string, config []byte) error {
return errIntentional
}
// IgnitionGet returns an error.
func (s *BrokenStore) IgnitionGet(name string) (string, error) {
return "", errIntentional
}
// IgnitionDelete returns an error.
func (s *BrokenStore) IgnitionDelete(name string) error {
return errIntentional
}
// GenericPut returns an error.
func (s *BrokenStore) GenericPut(name string, config []byte) error {
return errIntentional
}
// GenericGet returns an error.
func (s *BrokenStore) GenericGet(name string) (string, error) {
return "", errIntentional
}
// GenericDelete returns an error.
func (s *BrokenStore) GenericDelete(name string) error {
return errIntentional
}
// CloudGet returns an error.
func (s *BrokenStore) CloudGet(name string) (string, error) {
return "", errIntentional
}