1package fakedb
2
3import (
4 "github.com/charmbracelet/soft-serve/server/db"
5 "github.com/charmbracelet/soft-serve/server/db/types"
6)
7
8var _ db.Store = &FakeDB{}
9
10// FakeDB is a fake database for testing.
11type FakeDB struct{}
12
13// GetConfig implements db.Store.
14func (*FakeDB) GetConfig() (*types.Config, error) {
15 return nil, nil
16}
17
18// SetConfigAllowKeyless implements db.Store.
19func (*FakeDB) SetConfigAllowKeyless(bool) error {
20 return nil
21}
22
23// SetConfigAnonAccess implements db.Store.
24func (*FakeDB) SetConfigAnonAccess(string) error {
25 return nil
26}
27
28// SetConfigHost implements db.Store.
29func (*FakeDB) SetConfigHost(string) error {
30 return nil
31}
32
33// SetConfigName implements db.Store.
34func (*FakeDB) SetConfigName(string) error {
35 return nil
36}
37
38// SetConfigPort implements db.Store.
39func (*FakeDB) SetConfigPort(int) error {
40 return nil
41}
42
43// AddUser implements db.Store.
44func (*FakeDB) AddUser(name string, login string, email string, password string, isAdmin bool) error {
45 return nil
46}
47
48// CountUsers implements db.Store.
49func (*FakeDB) CountUsers() (int, error) {
50 return 0, nil
51}
52
53// DeleteUser implements db.Store.
54func (*FakeDB) DeleteUser(int) error {
55 return nil
56}
57
58// GetUser implements db.Store.
59func (*FakeDB) GetUser(int) (*types.User, error) {
60 return &types.User{}, nil
61}
62
63// GetUserByEmail implements db.Store.
64func (*FakeDB) GetUserByEmail(string) (*types.User, error) {
65 return &types.User{}, nil
66}
67
68// GetUserByLogin implements db.Store.
69func (*FakeDB) GetUserByLogin(string) (*types.User, error) {
70 return &types.User{}, nil
71}
72
73// GetUserByPublicKey implements db.Store.
74func (*FakeDB) GetUserByPublicKey(string) (*types.User, error) {
75 return &types.User{}, nil
76}
77
78// SetUserAdmin implements db.Store.
79func (*FakeDB) SetUserAdmin(*types.User, bool) error {
80 return nil
81}
82
83// SetUserEmail implements db.Store.
84func (*FakeDB) SetUserEmail(*types.User, string) error {
85 return nil
86}
87
88// SetUserLogin implements db.Store.
89func (*FakeDB) SetUserLogin(*types.User, string) error {
90 return nil
91}
92
93// SetUserName implements db.Store.
94func (*FakeDB) SetUserName(*types.User, string) error {
95 return nil
96}
97
98// SetUserPassword implements db.Store.
99func (*FakeDB) SetUserPassword(*types.User, string) error {
100 return nil
101}
102
103// AddUserPublicKey implements db.Store.
104func (*FakeDB) AddUserPublicKey(*types.User, string) error {
105 return nil
106}
107
108// DeleteUserPublicKey implements db.Store.
109func (*FakeDB) DeleteUserPublicKey(int) error {
110 return nil
111}
112
113// GetUserPublicKeys implements db.Store.
114func (*FakeDB) GetUserPublicKeys(*types.User) ([]*types.PublicKey, error) {
115 return nil, nil
116}
117
118// AddRepo implements db.Store.
119func (*FakeDB) AddRepo(name string, projectName string, description string, isPrivate bool) error {
120 return nil
121}
122
123// DeleteRepo implements db.Store.
124func (*FakeDB) DeleteRepo(string) error {
125 return nil
126}
127
128// GetRepo implements db.Store.
129func (*FakeDB) GetRepo(string) (*types.Repo, error) {
130 return &types.Repo{}, nil
131}
132
133// SetRepoName implements db.Store.
134func (*FakeDB) SetRepoName(string, string) error {
135 return nil
136}
137
138// SetRepoDescription implements db.Store.
139func (*FakeDB) SetRepoDescription(string, string) error {
140 return nil
141}
142
143// SetRepoPrivate implements db.Store.
144func (*FakeDB) SetRepoPrivate(string, bool) error {
145 return nil
146}
147
148// SetRepoProjectName implements db.Store.
149func (*FakeDB) SetRepoProjectName(string, string) error {
150 return nil
151}
152
153// AddRepoCollab implements db.Store.
154func (*FakeDB) AddRepoCollab(string, *types.User) error {
155 return nil
156}
157
158// DeleteRepoCollab implements db.Store.
159func (*FakeDB) DeleteRepoCollab(int, int) error {
160 return nil
161}
162
163// ListRepoCollabs implements db.Store.
164func (*FakeDB) ListRepoCollabs(string) ([]*types.User, error) {
165 return nil, nil
166}
167
168// ListRepoPublicKeys implements db.Store.
169func (*FakeDB) ListRepoPublicKeys(string) ([]*types.PublicKey, error) {
170 return nil, nil
171}
172
173// IsRepoPublicKeyCollab implements db.Store.
174func (*FakeDB) IsRepoPublicKeyCollab(string, string) (bool, error) {
175 return false, nil
176}
177
178// Close implements db.Store.
179func (*FakeDB) Close() error {
180 return nil
181}
182
183// CreateDB implements db.Store.
184func (*FakeDB) CreateDB() error {
185 return nil
186}